Skip to content

Commit 1edb1eb

Browse files
committed
exmdb_client: switch remote_id back to using PID instead of startuptime
When multiple services (midb, zcore) are started at the same time on the same machine, time(nullptr) yields the same value, which means they receive notifications they did not necessarily ask for. Fixes: gromox-1.16-78-gd099a2d04 Fixes: gromox-1.16-198-gfdd4c84e3
1 parent 542d1f6 commit 1edb1eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/exmdb_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void exmdb_client_init(unsigned int conn_max, unsigned int threads_max)
6565
mdcl_notify_stop = true;
6666
mdcl_conn_max = conn_max;
6767
mdcl_threads_max = threads_max;
68-
snprintf(mdcl_remote_id, arsizeof(mdcl_remote_id), "%llx.", static_cast<unsigned long long>(time(nullptr)));
68+
snprintf(mdcl_remote_id, arsizeof(mdcl_remote_id), "%u.", static_cast<unsigned int>(getpid()));
6969
auto z = strlen(mdcl_remote_id);
7070
guid_machine_id().to_str(mdcl_remote_id + z, arsizeof(mdcl_remote_id) - z, 32);
7171
fprintf(stderr, "[exmdb_client]: identity has been set to \"%s\"\n", mdcl_remote_id);

0 commit comments

Comments
 (0)