Skip to content

Commit

Permalink
[core] Use unified timestamp (ray-project#48894)
Browse files Browse the repository at this point in the history
@rynewang raised a good point at
ray-project#48843 (comment),
which points out better to use a unified timestamp instead of multiple.
The risk of which is (1) system clock vs steady clock; (2) different
algo/impl to get timestamp, etc.

Signed-off-by: hjiang <[email protected]>
  • Loading branch information
dentiny authored Nov 25, 2024
1 parent 559dd67 commit fe52a25
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/ray/gcs/gcs_server/gcs_health_check_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@ void GcsHealthCheckManager::HealthCheckContext::StartHealthCheck() {
new (&context_) grpc::ClientContext();
response_.Clear();

const auto now = std::chrono::system_clock::now();
auto deadline = now + std::chrono::milliseconds(manager_->timeout_ms_);
context_.set_deadline(deadline);
const auto now = absl::Now();
const auto deadline = now + absl::Milliseconds(manager_->timeout_ms_);
context_.set_deadline(absl::ToChronoTime(deadline));
stub_->async()->Check(
&context_,
&request_,
&response_,
[this, start = absl::FromChrono(now)](::grpc::Status status) {
&context_, &request_, &response_, [this, start = now](::grpc::Status status) {
// This callback is done in gRPC's thread pool.
STATS_health_check_rpc_latency_ms.Record(
absl::ToInt64Milliseconds(absl::Now() - start));
Expand Down

0 comments on commit fe52a25

Please sign in to comment.