Skip to content

Commit 8dc5746

Browse files
committed
DAOS-15084 engine: seed for rand when engine start
Otherwise, different engines may generate the same pseudo random sequence for rand() callers, that may cause trouble, for example when raft vote for pool service leader election. Signed-off-by: Fan Yong <fan.yong@intel.com>
1 parent fcd077f commit 8dc5746

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/engine/module.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ dss_module_setup_all(void)
297297
struct loaded_mod *mod;
298298
int rc = 0;
299299

300+
srand(dss_self_rank());
301+
300302
D_MUTEX_LOCK(&loaded_mod_list_lock);
301303
d_list_for_each_entry(mod, &loaded_mod_list, lm_lk) {
302304
struct dss_module *m = mod->lm_dss_mod;

0 commit comments

Comments
 (0)