Skip to content
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

Diagnostics Server IPC thread causes 20-40ms shutdown delays on Windows #12991

Closed
tommcdon opened this issue Jun 27, 2019 · 3 comments · Fixed by dotnet/coreclr#25602
Closed

Comments

@tommcdon
Copy link
Member

The Diagnostics Server IPC thread on Windows blocks in IpcStream::DiagnosticsIpc::Accept during shutdown. The blocking call resulting in the shutdown delay is located here:

https://github.com/dotnet/coreclr/blob/b388f6cd87d87f4a07fe966aaa1bc92f245165d9/src/debug/debug-pal/win/diagnosticsipc.cpp#L64

@tommcdon
Copy link
Member Author

@jorive @noahfalk @cshung

jorive referenced this issue in dotnet/coreclr Jul 17, 2019
…Windows (#25602)

Now, the diagnostics server attempts to do appropriate cleanup of its resources during shutdown.

```log
1. Closes the IPC channel
2. if Windows:
  - Cancel sync IO operations on the running server thread
3. Closes the running server thread handle
```

This change alleviates the issue because it manually cancel the blocking `ConnectNamedPipe` sync call in order to allow the server thread exit gracefully (instead of waiting for the OS to tear it down).

Fixes: https://github.com/dotnet/coreclr/issues/25463
@tommcdon
Copy link
Member Author

Re-opening this issue to track porting the fix to 3.0

@tommcdon tommcdon reopened this Jul 17, 2019
@jorive jorive removed their assignment Aug 1, 2019
@noahfalk
Copy link
Member

@tommcdon Are we good with this in 3.1 only? It doesn't seem that it would merit a 3.0 port and the issue is not currently assigned to 3.0 milestone. Recommend we close it.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants