Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Fix: Diagnostics Server IPC thread causes 20-40ms shutdown delays on Windows #25602

Merged
merged 6 commits into from
Jul 17, 2019
Merged

Fix: Diagnostics Server IPC thread causes 20-40ms shutdown delays on Windows #25602

merged 6 commits into from
Jul 17, 2019

Conversation

jorive
Copy link
Member

@jorive jorive commented Jul 8, 2019

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

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

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but please update the commit comment to describe why the issue occurs and why this change fixes it.

src/debug/debug-pal/unix/diagnosticsipc.cpp Outdated Show resolved Hide resolved
@jorive jorive marked this pull request as ready for review July 9, 2019 17:18
@jorive
Copy link
Member Author

jorive commented Jul 9, 2019

/cc @sergiy-k

Copy link

@josalem josalem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same sentiment as Noah. The Changes themselves look fine, but please elaborate on why this fixes the issue.

@jorive jorive merged commit dedef28 into dotnet:master Jul 17, 2019
@jorive jorive deleted the dev/diagnostics-server-shutdown branch July 17, 2019 16:20
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…Windows (dotnet/coreclr#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

Commit migrated from dotnet/coreclr@dedef28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diagnostics Server IPC thread causes 20-40ms shutdown delays on Windows
4 participants