Repository navigation
Fix listen failing with EISCONN on Windows after a Loop with a StatWatcher is freed - #128
Merged
Merged
Conversation
…tcher is freed Since 1.10.0, a Loop with a StatWatcher on Windows creates libev's evpipe, a pair of loopback TCP sockets. ev_loop_destroy closed them with the CRT close(), which only calls CloseHandle() and leaves Winsock state behind. A socket later imported from a WSAPROTOCOL_INFO with the same handle value inherits that state, and listen() fails with WSAEISCONN. Fluentd hits this through the socket manager of ServerEngine. Register the evpipe sockets with Ruby and close them with rb_w32_close(), which calls closesocket(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
Watson1978
added a commit
that referenced
this pull request
Oct 22, 2026
The fixture defined its own copy of the libev configuration, so settings added to ev_wrap.h, such as the evpipe handling from #128, did not reach the libev that it tests. Include libev.c, which builds libev for the extension, instead. Drop ext/libev from the include path as well, so that ev_wrap.h cannot resolve to the generated header of the same name in ext/libev. Co-authored-by: Claude Opus 5.5 <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.
Since 1.10.0, a
Coolio::Loopwith aStatWatcheron Windows creates libev's evpipe, a pair of loopback TCP sockets. When the loop is freed,ev_loop_destroyclosed them with the CRTclose(), which only callsCloseHandle()and leaves Winsock state behind. A socket later imported from aWSAPROTOCOL_INFOwith the same handle value inherits that state, andlisten()fails withWSAEISCONN. Fluentd hits this through the socket manager of ServerEngine, as in this job.This registers the evpipe sockets with Ruby through
EV_WIN32_HANDLE_TO_FDand closes them withrb_w32_close(), which callsclosesocket(). The new native spec frees 20 such loops and then listens on 30 imported sockets. Before this change, 12 to 18 of them failed withWSAEISCONNon a Windows 10 VM.Types of Changes
Contribution
🤖 Generated with Claude Code