Repository navigation
Fix XPub manual mode: Send between Receive and Subscribe clears m_lastPipe - #1153
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/zeromq/netmq/sessions/c4786470-ce78-4365-a544-f6685acb34b5 Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix intermittent error due to race condition on m_lastPipe field
Fix XPub manual mode: Send between Receive and Subscribe clears m_lastPipe
Apr 30, 2026
drewnoakes
marked this pull request as ready for review
April 30, 2026 12:49
drewnoakes
approved these changes
Apr 30, 2026
follesoe
pushed a commit
to BluEye-Robotics/netmq
that referenced
this pull request
May 4, 2026
…tPipe (zeromq#1153) * Initial plan * Fix race condition on m_lastPipe in XPub manual subscribe mode Agent-Logs-Url: https://github.com/zeromq/netmq/sessions/c4786470-ce78-4365-a544-f6685acb34b5 Co-authored-by: drewnoakes <350947+drewnoakes@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: drewnoakes <350947+drewnoakes@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.
In manual mode,
XPub.XSendunconditionally setm_lastPipe = nullafter every completed send. Sincem_lastPipeis also used to track the pipe of the most-recently-received subscription (soSubscribe()/Unsubscribe()can target it), anySend()call betweenReceiveFrameBytes()andSubscribe()silently dropped the subscription.Changes
XPub.cs—XSend: Only clearm_lastPipewhenm_lastPipeIsBroadcastistrue. The field is needed for broadcast exclusion, not for general sends; leaving it intact for regular publishes preserves the pipe reference that manual-modeSubscribe()/Unsubscribe()depend on.XPubSubTests.cs—ManualSubscribeAfterSend: New test covering the broken sequence: