Skip to content

Commit 552ebdb

Browse files
[Core] Announce worker port at end of constructor (#11036)
1 parent 29663d8 commit 552ebdb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/ray/core_worker/core_worker.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,6 @@ CoreWorker::CoreWorker(const CoreWorkerOptions &options, const WorkerID &worker_
335335
core_worker_server_->RegisterService(grpc_service_);
336336
core_worker_server_->Run();
337337

338-
// Tell the raylet the port that we are listening on.
339-
// NOTE: This also marks the worker as available in Raylet.
340-
RAY_CHECK_OK(local_raylet_client_->AnnounceWorkerPort(core_worker_server_->GetPort()));
341-
342338
// Set our own address.
343339
RAY_CHECK(!local_raylet_id.IsNil());
344340
rpc_address_.set_ip_address(options_.node_ip_address);
@@ -532,6 +528,10 @@ CoreWorker::CoreWorker(const CoreWorkerOptions &options, const WorkerID &worker_
532528
// Start the IO thread after all other members have been initialized, in case
533529
// the thread calls back into any of our members.
534530
io_thread_ = std::thread(&CoreWorker::RunIOService, this);
531+
// Tell the raylet the port that we are listening on.
532+
// NOTE: This also marks the worker as available in Raylet. We do this at the
533+
// very end in case there is a problem during construction.
534+
RAY_CHECK_OK(local_raylet_client_->AnnounceWorkerPort(core_worker_server_->GetPort()));
535535
}
536536

537537
void CoreWorker::Shutdown() {

0 commit comments

Comments
 (0)