code refine: reduce broadcast unique id frequence

This commit is contained in:
lizhenyu 2022-03-29 12:13:33 +08:00
parent f6524ca97b
commit ff176d597f
1 changed files with 5 additions and 0 deletions

View File

@ -213,6 +213,11 @@ bool CollectiveManager::CreateCommunicationGroup(const std::string &group_name,
// newly generated one.
if (RecoveryContext::GetInstance()->enable_recovery()) {
ret = CheckUniqueIDLatest(group_name, root_info_size, root_info);
if (!ret) {
// The time interval for querying latest unique id from scheduler: 3 second.
constexpr uint32_t kWaitDuration = 3;
std::this_thread::sleep_for(std::chrono::seconds(kWaitDuration));
}
}
}