fix: cleanup stale discovery nodes correctly#2
Merged
cursor[bot] merged 2 commits intomasterfrom Apr 13, 2026
Merged
Conversation
Co-authored-by: LycanW <LycanW@users.noreply.github.com>
Co-authored-by: LycanW <LycanW@users.noreply.github.com>
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.
Summary
ServiceRegistry::cleanuptime-unit mismatch (seconds vs milliseconds)nowand timeout to milliseconds before retain filterReproduction Evidence (before fix)
A standalone Rust repro (dependency-free) that mirrors current cleanup logic shows stale nodes are incorrectly retained:
Repro scenario:
now_ms - 20_000)timeout_secs = 10nowin seconds and compares against millisecond timestamps, so stale nodes never expireFix
src/discovery.rs:nowswitched fromas_secs()toas_millis()timeout_secsconverted totimeout_msWhy this is high-confidence
Validation
Environment Notes
In this cloud environment, crate-level
cargo testis currently blocked by toolchain/build issues unrelated to this logic:time = 0.3.47(edition2024metadata)zmq-sysC++ header resolution (<string>,<vector>not found)So validation used a dependency-free Rust repro to satisfy /repro and verify behavior.