Skip to content

fix(pd): keep overloaded masters from dropping healthy peers - #1780

Merged
sufubao merged 2 commits into
ModelTC:mainfrom
sufubao:fix/pd-master-overload-main
Dec 3, 2026
Merged

sufubao merged 2 commits into
ModelTC:mainfrom
sufubao:fix/pd-master-overload-main

Conversation

@sufubao

@sufubao sufubao commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Ports #1778, which landed on glm53_optim, to main.

A PD master HTTP worker handles prompt preparation, registration heartbeats, and health probes on the same event loop. When tokenization or chat-template rendering delays a heartbeat read, a fixed-topology master can drop a healthy peer and start returning 503.

  • Bound generation and token-count requests before parsing their bodies. Keep a slot until the request or stream finishes, and run CPU-heavy prompt work in a dedicated pool sized for the worker's CPU quota.
  • Give a timed-out registration read one additional deadline when the local event loop stalled. Probe each distinct P/D address once and recheck worker health and registration state when the probes return.
  • Account for split connections on main. Replacing a socket in place on an existing node invalidates an in-flight health result. Regression tests cover socket replacement, disconnect, and loss of one of several connections.
  • Pin and verify the patched Hypercorn handler used for early HTTP/2 overload responses. Update the main serving Dockerfile and the source installation guides.

Verification at bde44771b

  • 179 tests passed in a Linux serving container, covering PD admission, cancellation, tokenization, WebSocket lifecycles, split connections, topology, Hypercorn startup, and chat request validation.
  • All three additional tokenizer import-isolation cases passed, bringing the total to 182 distinct passing tests. Llama passed on an isolated rerun after its first subprocess timed out in the emulated container.
  • The pinned Hypercorn HTTP/2 handler passed its SHA-256 check. GitHub pre-commit and git diff --check passed.

The CPU-limited replay and wire-protocol results for the original branch are recorded in #1778.

@sufubao
sufubao merged commit da867af into ModelTC:main Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant