fix(gateway): conservative zombie cleanup on windows#249
Merged
1186258278 merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
Fix for #244 Hidden-start repeat loop: cleanup_zombie_gateway_processes used a single /health probe to decide whether a port-listening process is a zombie. When Gateway reaches 'ready' but is still initializing (loading plugins, connecting channels, warming up networks), a single probe can time out -> the healthy Gateway gets killed -> start_service_impl Hidden-starts a new one -> loop. Add is_gateway_port_responsive_with_retry: 3 attempts with 800ms interval before classifying as zombie. Maximum wait 2.4s for a process that's genuinely healthy to show up as such. Effect: healthy Gateway no longer misidentified during warm-up, Hidden-start no longer triggered on an already-ready Gateway. Refs #244
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.
Problem
On Windows, when Gateway reaches
readybut is still initializing, a single /health probe can time out —cleanup_zombie_gateway_processesthen kills the healthy Gateway, andstart_service_implHidden-starts a new one. Loop continues.Users reported this as
Gateway 已成功 ready,但 ClawPanel 又 Hidden-start 了一个新的in #244.Fix
New helper
is_gateway_port_responsive_with_retry(port, retries, interval)— 3 attempts with 800ms gap (up to 2.4s tolerance window). Used incleanup_zombie_gateway_processes.Verification
cargo checkpassescargo fmt --checkpassescargo clippy -D warningspassesRefs #244 (Hidden-start loop — warm-up window respected)