mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
random a job id in c++ worker (#13982)
This commit is contained in:
parent
ec94214957
commit
09242e6d31
1 changed files with 6 additions and 1 deletions
|
@ -70,7 +70,12 @@ void ProcessHelper::RayStart(std::shared_ptr<RayConfig> config,
|
|||
options.store_socket = store_socket;
|
||||
options.raylet_socket = raylet_socket;
|
||||
if (options.worker_type == WorkerType::DRIVER) {
|
||||
options.job_id = JobID::FromInt(0);
|
||||
/// TODO(Guyang Song): Get next job id from core worker by GCS client.
|
||||
/// Random a number to avoid repeated job ids.
|
||||
/// The repeated job ids will lead to task hang when driver connects to a existing
|
||||
/// cluster more than once.
|
||||
std::srand(std::time(nullptr));
|
||||
options.job_id = JobID::FromInt(std::rand());
|
||||
}
|
||||
options.gcs_options = gcs_options;
|
||||
options.enable_logging = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue