-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/6.0][EventPipe] Fix reverse connection socket leaking to child processes. #65768
[release/6.0][EventPipe] Fix reverse connection socket leaking to child processes. #65768
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source change LGTM (assuming that whatever the build issue is gets resolved)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. We should take for consideration in 6.0.x
Branch is now open for Tactics-approved changes. The PR is signed off, has the |
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.