Skip to content

[Bugfix][Rust Frontend][ZMQ] Run ZMQ transport I/O on the dedicated runtime - #64294

Merged
BugenZhao merged 2 commits into
vllm-project:mainfrom
reidliu41:fix-zmq-runtime-ownership
Nov 2, 2026
Merged

BugenZhao merged 2 commits into
vllm-project:mainfrom
reidliu41:fix-zmq-runtime-ownership

Conversation

@reidliu41

@reidliu41 reidliu41 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Create and connect Rust frontend ZMQ sockets on the dedicated runtime so
socket readiness and background transport tasks use the same Tokio I/O
driver. Caller-runtime load or shutdown can no longer delay or terminate
engine communication.

Claims

  • Registers HandshakeOwner and Bootstrapped transport I/O with the dedicated
    ZMQ runtime instead of the runtime that calls EngineCoreClient::connect.
  • Keeps engine communication functional after the connecting runtime is shut
    down.
  • Preserves the existing transport protocol, configuration, and public API.
  • Retains cancellation safety while connection setup runs on the dedicated
    runtime.

Validation

cargo nextest run --locked -p vllm-engine-core-client \
  client_transport_outlives_connecting_runtime

A Linux epoll probe with a mock engine confirmed the runtime ownership change:

Measurement Before After
ZMQ TCP descriptors on the connecting runtime 4 0
ZMQ TCP descriptors on the dedicated runtime 0 4
Output delay while the connecting runtime was blocked ~4.70 s 0.43–0.75 ms

Details

Tokio associates TCP resources with the I/O driver of the runtime active when
those resources are created. Transport setup previously ran on the caller
runtime, while build_zmq_runtime() was called only after the sockets had
already been bound or connected. Background transport tasks ran on the
dedicated runtime, but socket readiness was still driven by the caller
runtime.

The dedicated runtime is now created before transport setup. The complete
connection path runs on that runtime, and the same runtime is passed into
from_connected for background task execution and lifetime ownership.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

Signed-off-by: reidliu41 <reid201711@gmail.com>
@reidliu41
reidliu41 marked this pull request as ready for review October 28, 2026 14:28

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added rust bug Something isn't working labels Oct 28, 2026

@BugenZhao BugenZhao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a good catch!

@BugenZhao

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #99162 for commit d7ae0947010b.

ℹ️ This PR is 312 commits behind upstream main. Merged upstream main into this branch as d7ae0947010b before starting CI. Pull the branch before pushing more changes.

@BugenZhao
BugenZhao merged commit fa62ea9 into vllm-project:main Nov 2, 2026
30 checks passed
@reidliu41

Copy link
Copy Markdown
Contributor Author

Thank you for the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants