Skip to content

Commit

Permalink
change error code name of boost timer (#9417)
Browse files Browse the repository at this point in the history
  • Loading branch information
kisuke95 authored Jul 14, 2020
1 parent 3c90f96 commit 276fe10
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/ray/gcs/gcs_client/service_based_gcs_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand Down
4 changes: 2 additions & 2 deletions src/ray/gcs/gcs_server/gcs_node_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/ray/util/asio_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inline void execute_after(boost::asio::io_context &io_context,
auto timer = std::make_shared<boost::asio::deadline_timer>(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();
}
});
Expand Down

0 comments on commit 276fe10

Please sign in to comment.