mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 16:46:37 +08:00
random a job id in c++ worker (#13982)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user