Repository navigation
[Backport release-1.19] fix(clients): give each sidecar health check attempt a timeout - #1270
Merged
Merged
Conversation
* fix(health): bound each sidecar health probe by DAPR_HEALTH_TIMEOUT DaprHealth.wait_for_sidecar() called urllib.request.urlopen with no timeout. DAPR_HEALTH_TIMEOUT only limited the retry loop, so a sidecar (or any process on that port) that accepted the connection but never replied blocked the call, and every client constructor that waits for the sidecar, forever. Each probe now gets a timeout equal to what is left of DAPR_HEALTH_TIMEOUT, with a 0.5 s floor so the last probe can still get a reply. The async health check had the same shape, bounded only by aiohttp's 300 s default, and now uses the same per-probe timeout. Retry, logging and the final TimeoutError are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Casper Nielsen <casper@diagrid.io> * fix(health): log async probe timeouts clearly and note sync timeout scope aiohttp's timeout error has an empty message, so an async probe timeout was logged as 'Unexpected error during health check:' with nothing after it. Catch asyncio.TimeoutError and log 'timed out', like the sync client. Also note in the sync client that urllib's timeout applies per socket operation, not to the whole request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Casper Nielsen <casper@diagrid.io> * fix(health): log sync read timeouts as timed out, not unexpected urllib wraps only connect/send errors in URLError, so a read timeout in getresponse() reached the generic branch. Also measure the health budget with time.monotonic() in both clients so a clock jump cannot stretch it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Casper Nielsen <casper@diagrid.io> * refactor(tests): move listen_without_replying into a shared fake_servers module Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Casper Nielsen <casper@diagrid.io> --------- Signed-off-by: Casper Nielsen <casper@diagrid.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b14b283) Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-1.19 #1270 +/- ##
===============================================
Coverage ? 86.66%
===============================================
Files ? 163
Lines ? 12919
Branches ? 0
===============================================
Hits ? 11196
Misses ? 1723
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sicoyle
approved these changes
Oct 15, 2026
dapr-bot
enabled auto-merge (squash)
October 15, 2026 14:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport b14b283 from #1241.