This commit is contained in:
Dmitri Gekhtman 2021-05-21 11:45:40 -07:00
parent 33d9fc9a8b
commit b65bc65c1a
2 changed files with 11 additions and 11 deletions

View file

@ -2818,15 +2818,16 @@ void CoreWorker::HandleExit(const rpc::ExitRequest &request, rpc::ExitReply *rep
// any object pinning RPCs in flight. // any object pinning RPCs in flight.
bool is_idle = !own_objects && pins_in_flight == 0; bool is_idle = !own_objects && pins_in_flight == 0;
reply->set_success(is_idle); reply->set_success(is_idle);
send_reply_callback(Status::OK(), send_reply_callback(
[this, is_idle]() { Status::OK(),
// If the worker is idle, we exit. [this, is_idle]() {
if (is_idle) { // If the worker is idle, we exit.
Exit(rpc::WorkerExitType::INTENDED_EXIT); if (is_idle) {
} Exit(rpc::WorkerExitType::INTENDED_EXIT);
}, }
// We need to kill it regardless if the RPC failed. },
[this]() { Exit(rpc::WorkerExitType::INTENDED_EXIT); }); // We need to kill it regardless if the RPC failed.
[this]() { Exit(rpc::WorkerExitType::INTENDED_EXIT); });
} }
void CoreWorker::YieldCurrentFiber(FiberEvent &event) { void CoreWorker::YieldCurrentFiber(FiberEvent &event) {

View file

@ -75,8 +75,7 @@ int main(int argc, char *argv[]) {
storage->InternalConfigTable().Put(ray::UniqueID::Nil(), config, on_done)); storage->InternalConfigTable().Put(ray::UniqueID::Nil(), config, on_done));
boost::asio::io_service::work work(service); boost::asio::io_service::work work(service);
service.run(); service.run();
}) }).detach();
.detach();
promise->get_future().get(); promise->get_future().get();
const ray::stats::TagsType global_tags = { const ray::stats::TagsType global_tags = {