discovery: poll for the meta instead of timing out + rich logging (0.6.3) - #21
Merged
Merged
Conversation
Registration no longer raises TimeoutError when the meta isn't up yet (which crashed the SGLang scheduler); start() polls indefinitely with periodic 'waiting for meta ... retrying' logs and proceeds once it registers. Added operability logging: startup identity + which node is the meta; meta logs each register/re-register/deregister/prune with member count+list; client logs successful registration, every heartbeat (known=, members), and membership changes (joined/left). New test: register polls until the meta appears (no crash). Full suite 53 passed. Co-authored-by: 兰州小红鸡 <flyphp@outlook.com>
flymysql
marked this pull request as ready for review
June 2, 2026 06:13
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.
Symptom
A node started before the meta crashed the whole host process:
DiscoveryClient.start()did a singleregister()RPC and let aTimeoutErrorpropagate, killing the SGLang scheduler.Changes
start()now calls_register_blocking()which retriesregister()indefinitely (untilstop()), logging periodically —discovery: node=… waiting for meta … (attempt N, Ms elapsed): …; retrying in 2.0s. Once the meta is up it registers and continues. No more crash.REGISTERED/ re-register /DEREGISTERED/ dead-node prune, each with the current member count + id list, and flags heartbeats from unknown nodes;known=, member count), and membership changes (joined=… left=…).register_retry_intervalknob (default 2.0s).Verification
test_register_polls_until_meta_is_up: a client started before the meta keeps polling (no exception) and registers once theDiscoveryServercomes up.Bumps to 0.6.3. Pure-Python (no extension rebuild needed).
Validate on the node (immediate)
pip install --force-reinstall --no-deps "git+https://github.com/flymysql/PeerCache@cursor/discovery-poll-logging-49da"Start a worker before the meta — it now logs
waiting for meta …and joins once the meta is up, instead of dying.