Fix Ethernet receiver teardown race - #876
Open
Changho Hwang (chhwang) wants to merge 10 commits into
Open
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
|
/azp run mscclpp-ut |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Ethernet receiver teardown races by separating socket shutdown from descriptor closure.
Changes:
- Adds exact-read outcomes and non-closing socket shutdown.
- Publishes receiver failures and safely joins before closing descriptors.
- Adds teardown/EOF tests and migrates socket logging.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/bootstrap/socket.cc |
Implements shutdown and exact-read handling. |
src/core/connection.cc |
Reorders teardown and propagates receiver errors. |
src/core/include/connection.hpp |
Adds receiver lifecycle/error state. |
src/core/include/socket.h |
Declares receive results and shutdown API. |
test/unit/socket_tests.cc |
Adds socket framing and teardown tests. |
Suppressed comments (1)
test/unit/socket_tests.cc:153
descriptorReusedis effectively guaranteed whenever/dev/nullopens successfully:dup2succeeds even whenreceiverFdis still open because it silently closes the target first. As a result, this assertion cannot verify thatclose()released the receiver descriptor; check forEBADFdirectly instead.
int reuseFd = ::open("/dev/null", O_RDONLY);
const bool descriptorReused = reuseFd == receiverFd || (reuseFd >= 0 && ::dup2(reuseFd, receiverFd) == receiverFd);
if (reuseFd >= 0 && reuseFd != receiverFd) ::close(reuseFd);
if (descriptorReused) ::close(receiverFd);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
/azp run mscclpp-ut |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Binyang Li (Binyang2014)
approved these changes
Aug 26, 2026
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
Validation