diff --git a/src/ray/gcs/gcs_client/service_based_gcs_client.cc b/src/ray/gcs/gcs_client/service_based_gcs_client.cc index 51399e786..6f5a36b2b 100644 --- a/src/ray/gcs/gcs_client/service_based_gcs_client.cc +++ b/src/ray/gcs/gcs_client/service_based_gcs_client.cc @@ -146,8 +146,8 @@ void ServiceBasedGcsClient::PeriodicallyCheckGcsServerAddress() { RayConfig::instance().gcs_service_address_check_interval_milliseconds()); detect_timer_->expires_from_now(check_period); detect_timer_->async_wait([this](const boost::system::error_code &error) { - if (error == boost::system::errc::operation_canceled) { - // `operation_canceled` is set when `detect_timer_` is canceled or destroyed. + if (error == boost::asio::error::operation_aborted) { + // `operation_aborted` is set when `detect_timer_` is canceled or destroyed. return; } RAY_CHECK(!error) << "Checking gcs server address failed with error: " diff --git a/src/ray/gcs/gcs_server/gcs_node_manager.cc b/src/ray/gcs/gcs_server/gcs_node_manager.cc index 3e0efdd28..b26423375 100644 --- a/src/ray/gcs/gcs_server/gcs_node_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_node_manager.cc @@ -99,8 +99,8 @@ void GcsNodeManager::NodeFailureDetector::ScheduleTick() { RayConfig::instance().raylet_heartbeat_timeout_milliseconds()); detect_timer_.expires_from_now(heartbeat_period); detect_timer_.async_wait([this](const boost::system::error_code &error) { - if (error == boost::system::errc::operation_canceled) { - // `operation_canceled` is set when `detect_timer_` is canceled or destroyed. + if (error == boost::asio::error::operation_aborted) { + // `operation_aborted` is set when `detect_timer_` is canceled or destroyed. // The Monitor lifetime may be short than the object who use it. (e.g. gcs_server) return; } diff --git a/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc b/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc index af01ad795..031102891 100644 --- a/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc +++ b/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc @@ -221,7 +221,7 @@ void GcsPlacementGroupScheduler::CancelResourceReserve( return_timer_.expires_from_now(boost::posix_time::milliseconds(5)); return_timer_.async_wait( [this, bundle_spec, node](const boost::system::error_code &error) { - if (error == boost::system::errc::operation_canceled) { + if (error == boost::asio::error::operation_aborted) { return; } else { CancelResourceReserve(bundle_spec, node); diff --git a/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc b/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc index adf148b35..980fdaa61 100644 --- a/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc +++ b/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc @@ -52,7 +52,7 @@ void GcsRedisFailureDetector::ScheduleTick() { RayConfig::instance().gcs_redis_heartbeat_interval_milliseconds()); detect_timer_.expires_from_now(detect_period); detect_timer_.async_wait([this](const boost::system::error_code &error) { - if (error == boost::system::errc::operation_canceled) { + if (error == boost::asio::error::operation_aborted) { return; } RAY_CHECK(!error) << "Detecting redis failed with error: " << error.message(); diff --git a/src/ray/util/asio_util.h b/src/ray/util/asio_util.h index 8ef2a7296..1e50f8145 100644 --- a/src/ray/util/asio_util.h +++ b/src/ray/util/asio_util.h @@ -21,7 +21,7 @@ inline void execute_after(boost::asio::io_context &io_context, auto timer = std::make_shared(io_context); timer->expires_from_now(boost::posix_time::milliseconds(delay_milliseconds)); timer->async_wait([timer, fn](const boost::system::error_code &error) { - if (error != boost::system::errc::operation_canceled && fn) { + if (error != boost::asio::error::operation_aborted && fn) { fn(); } });