Repository navigation
fix: the package proxy is healthy only when its serving loop answers - #100
Merged
Merged
Conversation
Its health check only tested that the socket file exists, so a hung proxy or a socket file left by a crash read as healthy (hunt toolgate-4 F20). It now connects and waits up to 5 s for an answer; the peer check closing a non-client counts as one, and the peer check itself is unchanged.
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.
Hunt toolgate-4 F20.
proxy.health()returned 0 whenever the socket file existed, so a hung proxy or a socket file left by a crash read as healthy.Now it connects, sends one request line, and waits up to 5 s for any answer or close. A sandbox client gets an HTTP reply. Any other peer (the health check usually runs as the proxy's own user) has its connection closed by the peer check, which counts as alive. A stale socket refuses the connection and a hung loop times out: both are unhealthy. The peer check (
verify_request) is unchanged.Tests (toolgate/tests/test_sandbox_proxy.py, POSIX only): no socket; a stale socket file; a listener that never accepts; a live proxy for a client and for a non-client. Run under WSL: 8 passed on the branch, and on main the stale-socket and hung-loop tests fail. ruff ok, types ok.