do-not-merge: IO completion port POC#40569
Draft
OneBlue wants to merge 4 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a proof-of-concept IOCP-backed implementation for MultiHandleWait, aiming to remove the 64-handle wait limit and support IO completion routing across composite handles.
Changes:
- Replaces
GetHandle()-based waiting withBind()-based IOCP association for overlapped IO handles. - Adds IOCP binding lifetime management and threadpool-wait support for event handles.
- Adds a >64-handle unit test and quotes MSI installer/log paths in installer tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/windows/common/HandleIO.h |
Adds IOCP binding abstractions and updates handle interfaces for IOCP-based dispatch. |
src/windows/common/HandleIO.cpp |
Implements IOCP binding, event posting, and MultiHandleWait IOCP run loop. |
src/windows/common/precomp.h |
Adds <list> for the new MultiHandleWait storage. |
src/windows/wslcsession/PortRelayHandle.h |
Updates port relay accept handle to the new Bind() interface. |
src/windows/wslcsession/PortRelayHandle.cpp |
Binds port relay accept completions to the listening socket/overlapped pair. |
test/windows/UnitTests.cpp |
Adds coverage for waiting on more than 64 handles. |
test/windows/InstallerTests.cpp |
Quotes MSI command-line paths for install and log arguments. |
| // m_handles), each IOCPHandle's destructor detaches its kernel handle so | ||
| // external consumers (e.g. boost::asio::stream::assign, or a later | ||
| // MultiHandleWait reusing the same socket) can rebind freely. | ||
| std::map<HANDLE, IOCPHandle> m_iocpBindings; |
Comment on lines
+1173
to
+1175
| if (error == WAIT_TIMEOUT) | ||
| { | ||
| break; |
Comment on lines
+128
to
+133
| // Best-effort: not every device type supports FileCompletionNotificationModes. If | ||
| // unsupported, the worst case is a redundant packet for a synchronous success which | ||
| // is filtered out in MultiHandleWait::Run. | ||
| if (!SetFileCompletionNotificationModes(Handle, FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) | ||
| { | ||
| LOG_LAST_ERROR_IF(GetLastError() != ERROR_INVALID_FUNCTION); |
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 of the Pull Request
This change brings a POC of the IOCP switch.
Advantages:
Drawbacks:
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed