Repository navigation
fix(runtime): remove ZMQ publisher port allocation race - #14566
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughZMQ publisher binding now uses libzmq to allocate ephemeral TCP ports and returns the actual endpoint. The temporary listener and standalone I/O error test were removed. Tests cover concurrent unique ports and ephemeral PUB/SUB communication. ChangesZMQ ephemeral binding
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Publishers now obtain ephemeral TCP ports atomically through ZMQ and report the assigned endpoint, eliminating the temporary-port reservation race. The covered binding and communication behavior indicates no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
|
/ok to test 84407f7 |
Bind ephemeral ports on the actual ZMQ publisher socket and read back its endpoint. Avoid releasing a temporary TCP port before the publisher binds. Preserve the requested TCP host and existing socket settings. Base: 7540ca8 Validation: 45 focused event-plane tests; cargo check -p dynamo-runtime --locked; cargo clippy -p dynamo-runtime --lib --tests --locked -- -D warnings; cargo fmt --all --check; git diff --check. Signed-off-by: jthomson04 <[email protected]>
The test did not exercise the bind race it was named for. The duplicate-port assertion cannot fail under the old implementation either, since the OS never hands two live listeners the same ephemeral port, and the race itself surfaced as a bind error that the test only caught incidentally and only within a narrow window. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: jthomson04 <[email protected]>
84407f7 to
449a695
Compare
|
/ok to test 449a695 |
Summary
Remove a race during concurrent ZMQ publisher startup. The existing code selects a free port with a temporary TCP listener, closes it, then binds the publisher to that port. Another socket can take the port between those steps.
Details
:0endpoints to:*, preserving the host, and bind the actual ZMQ socket once.get_last_endpoint()for logging and discovery.No new locks, dependencies, wire changes, or per-request work. Publisher retries and readiness are unchanged.
Where should the reviewer start?
lib/runtime/src/transports/event_plane/zmq_transport.rs, starting withZmqPubTransport::bind.Validation
cargo test -p dynamo-runtime --lib transports::event_plane— 44 passed, covering PUB/SUB delivery through the assigned endpoint.cargo check -p dynamo-runtime --lockedcargo clippy -p dynamo-runtime --lib --tests --locked -- -D warningscargo fmt --all --checkgit diff --checkNo cluster runs or active benchmark changes.
Related Issues
Summary by CodeRabbit