Fix a crash when unknown worker registering to raylet (#4992)

This commit is contained in:
Qing Wang 2019-06-17 13:34:23 +08:00 committed by Hao Chen
parent 05e2748070
commit b08765a08b

View file

@ -164,7 +164,10 @@ void WorkerPool::RegisterWorker(const std::shared_ptr<Worker> &worker) {
state.registered_workers.insert(std::move(worker));
auto it = state.starting_worker_processes.find(pid);
RAY_CHECK(it != state.starting_worker_processes.end());
if (it == state.starting_worker_processes.end()) {
RAY_LOG(WARNING) << "Received a register request from an unknown worker " << pid;
return;
}
it->second--;
if (it->second == 0) {
state.starting_worker_processes.erase(it);