Skip to content

Commit 1fa4b49

Browse files
committed
fix(review): log transport errors before treating as failed probe
The previous fix used `unwrap_or(false)` which silently discarded the error details. Operators debugging why a worker won't come Ready had no visibility into the underlying cause (connection refused, TLS failure, DNS resolution failure, timeout, etc.). Switched to `unwrap_or_else` which logs the error with the worker URL at warn level before returning false. This preserves the existing state-machine behavior (transport errors still count as failed probes and feed the Pending timeout / NotReady→Failed paths) while making the underlying cause discoverable from logs. Refs: PR #1102 review feedback Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
1 parent cec40bf commit 1fa4b49

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

model_gateway/src/worker/worker.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,23 @@ impl Worker for BasicWorker {
610610
self.total_pending_probes.fetch_add(1, Ordering::Relaxed);
611611
}
612612

613-
// Transport-level errors (e.g. gRPC connect failure) are treated as
614-
// failed probes rather than short-circuiting, so the Pending timeout
615-
// and NotReady→Failed paths can observe them.
616-
let probe_result = match &self.metadata.spec.connection_mode {
613+
// Transport-level errors (e.g. gRPC connect failure, TLS handshake
614+
// failure, DNS resolution failure) are treated as failed probes
615+
// rather than short-circuiting, so the Pending timeout and
616+
// NotReady→Failed paths can observe them. The error is logged with
617+
// the worker URL so operators can debug why a worker won't come Ready.
618+
let health_result = match &self.metadata.spec.connection_mode {
617619
ConnectionMode::Http => self.http_health_check().await,
618620
ConnectionMode::Grpc => self.grpc_health_check().await,
619-
};
620-
let health_result = probe_result.unwrap_or(false);
621+
}
622+
.unwrap_or_else(|err| {
623+
tracing::warn!(
624+
worker_url = %self.metadata.spec.url,
625+
error = %err,
626+
"Health check probe transport error (treating as failed probe)"
627+
);
628+
false
629+
});
621630

622631
if health_result {
623632
self.consecutive_failures.store(0, Ordering::Release);

0 commit comments

Comments
 (0)