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

Modified #41008 without GetOverlappedResultEx #41236

Merged
2 commits merged into from
Aug 25, 2020

Conversation

josalem
Copy link
Contributor

@josalem josalem commented Aug 23, 2020

fixes #41217

Same changes as #41008 but without using GetOverlappedResultEx which is only available in Windows 8 forward. This modification does not change the behavior of the patch.

Below is the PR description from #41008.


fixes #41007

These changes are intended to be backported to 5.0-rc1 once merged into master.

As described in #41007, the runtime was treating ERROR_BROKEN_PIPE as a generic error rather than a hangup error. These changes correct that misbehavior and reset the connection on generic errors in case additional errors have been missed. Additionally, they simplify the logic of IpcStream::{Read|Write} to use GetOverlappedResultEx which directly takes a timeout rather than GetOverlappedResult followed by WaitForSingleObject.

CC @jander-msft @tommcdon


Customer Impact

This currently impacts dotnet-monitor on Windows.

If a Connect Diagnostic Port on Windows doesn't call DisconnectNamedPipe before closing it will cause runtimes to be unable to connect to another Connect Diagnostic Port at the same address. For example, dotnet-monitor currently does not call DisconnectNamedPipe before closing, so if a user restarts dotnet-monitor they won't see any apps show up if they connected before.

Testing

I have tested these changes locally with dotnet-monitor both under a debugger and without the debugger. These fix the observed issue. I did not add an individual test for this scenario, but one could be created.

Risk

This is a low risk patch. It simply improves the error handling and corrects a misbehavior.

@josalem josalem added this to the 5.0.0 milestone Aug 23, 2020
@josalem josalem added this to Needs Triage in .NET Core Diagnostics via automation Aug 23, 2020
@josalem josalem self-assigned this Aug 23, 2020
@ghost
Copy link

ghost commented Aug 23, 2020

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@josalem
Copy link
Contributor Author

josalem commented Aug 24, 2020

coreclr pri0 Win-x64 failure is #40916
libraries Win-x86 failure doesn't seem to have a specific issue for it, but AzDO says the System.Text.Json workitem has been failing as far back as August 16th. This specific failure looks like a 15 minute timeout on the workitem.

These failures don't look related to these changes; I'll rerun these two jobs.

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.

LGTM, thanks @josalem!

.NET Core Diagnostics automation moved this from Needs Triage to In Progress Aug 25, 2020
@josalem josalem force-pushed the dev/josalem/win7-friendly-41008 branch from 032e692 to 691983d Compare August 25, 2020 00:51
@ghost
Copy link

ghost commented Aug 25, 2020

Hello @josalem!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit c0862a5 into dotnet:master Aug 25, 2020
.NET Core Diagnostics automation moved this from In Progress to Done Aug 25, 2020
josalem pushed a commit to josalem/runtime that referenced this pull request Aug 25, 2020
* Revert "Revert "Improve Windows error handling in Diagnostics IPC (dotnet#41008)" (dotnet#41220)"

This reverts commit 15839c0.

* don't use win8+ API
josalem pushed a commit that referenced this pull request Aug 25, 2020
…n Windows (#41338)

* Revert "Revert "Improve Windows error handling in Diagnostics IPC (#41008)" (#41220)"

This reverts commit 15839c0.

* don't use win8+ API
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

All libraries tests failing on Win7 x86 Error handling is too brittle for Windows IpcStreamFactory/IPC PAL
3 participants