[release/6.0][EventPipe] Fix reverse connection socket leaking to child processes.#65768
Merged
carlossanlop merged 2 commits intodotnet:release/6.0from Mar 8, 2022
Merged
Conversation
…ld processes. Sockets were getting leaked upon accepting connections. This meant that child processes could cause fully terminated tracing sessions and other IPC connections alive, causing clients to wait for input indefinitely. This sets the CLOEXEC bits on the socket atomically upon accepting if the OS provides the capability, falling back to a best effort fcntl on systems like macOS and x866 Android emulators. Port of dotnet#65365 to release/6.0.
Member
|
noahfalk
approved these changes
Feb 23, 2022
Member
noahfalk
left a comment
There was a problem hiding this comment.
Source change LGTM (assuming that whatever the build issue is gets resolved)
jeffschwMSFT
approved these changes
Feb 24, 2022
Member
jeffschwMSFT
left a comment
There was a problem hiding this comment.
Approved. We should take for consideration in 6.0.x
Therzok
approved these changes
Mar 1, 2022
Contributor
|
Branch is now open for Tactics-approved changes. The PR is signed off, has the |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Customer Impact
Clients requesting information through EventPipe could see a connection being active for an indeterminate even though the target runtime has closed it if the process forked in the time window from the session started to the time it gets finished. This was reported by customers through VS 4 mac.
Description
Sockets were getting leaked upon accepting connections. This meant that child processes could cause fully terminated tracing sessions and other IPC connections alive, causing clients to wait for input indefinitely. This sets the CLOEXEC bits on the socket atomically upon accepting if the OS provides the capability, falling back to a best effort fcntl on systems like macOS and x866 Android emulators.
Port of #65365 to release/6.0.
Regression
No
Testing
Validated customer scenario on top of testing.
Risk
Low. The change mitigates risk by preventing sockets getting inherited and ensuring the state is clean. When possible it does it as an atomic kernel operation. Should fall back to prior behavior if close on exec is not available.