Remove macOS Socket.Select workaround that caused Cleanup() to hang#1142
Open
follesoe wants to merge 1 commit intozeromq:masterfrom
Open
Remove macOS Socket.Select workaround that caused Cleanup() to hang#1142follesoe wants to merge 1 commit intozeromq:masterfrom
follesoe wants to merge 1 commit intozeromq:masterfrom
Conversation
The macOS workaround split Socket.Select into two separate calls (one for readList, one for errorList). When the timeout was infinite (-1), the second call blocked forever waiting for an error condition that never occurred, preventing the Reaper from processing Stop commands and causing Cleanup() to hang indefinitely. The underlying .NET runtime bug (dotnet/corefx#39617) was reported in 2019 and fixed in .NET 9 (2024). However, the Cleanup hang indicates the workaround never worked as intended. Now that the underlying issue is also resolved on broadly available .NET versions for macOS and iOS, the workaround can be safely removed. Fixes zeromq#1040 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
Socket.Selectworkaround inPoller.csthat split the call into two separate invocations (one forreadList, one forerrorList)Stopcommands, causingCleanup()to hang indefinitelyCleanuphang indicates the workaround never worked as intendedSee #1040 (comment) for a detailed root cause analysis.
Fixes #1040
Test plan
net8.0,net472,netstandard2.1)Cleanup(block: false)no longer hangs🤖 Generated with Claude Code