-
Notifications
You must be signed in to change notification settings - Fork 10.4k
backport 8.0 - http.sys accept loop - mitigate against break due to possible conflicting IO callbacks #54437
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
Conversation
1. handle MRTVS cascading fault breaking the accept loop 2. log any expectation failures # Conflicts: # src/Servers/HttpSys/src/AsyncAcceptContext.cs
…itching - lock new critical log messages behind app-context switch
approved by servicing tactics 8th /cc @wtgodbe |
@adityamandaleeka @Tratcher @halter73 @JamesNK code review approval needed ASAP |
var value = Interlocked.Exchange(ref _expectedCompletionCount, 1); // should have been 0 | ||
if (value != 0) | ||
{ | ||
if (_logExpectationFailures) |
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.
Why even gate this behind a flag? I doubt many people will know to turn it on, and if these are failing commonly, wouldn't we want to hear about it? You could disable the HttpSysListener logger if it's too noisy.
Or at least make it opt-out. This is another case where being able to filter logs by event ID would be nice. dotnet/runtime#49924
{ | ||
Log.AcceptSetExpectationMismatch(_logger, value); | ||
} | ||
Debug.Assert(false, nameof(SetExpectCompletion)); // fail hard in debug |
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.
Nit:
Debug.Assert(false, nameof(SetExpectCompletion)); // fail hard in debug | |
Debug.Fail($"nameof(SetExpectCompletion) - {value}"); // fail hard in debug |
backport #54368 to .NET 8
Context: #54251
System.InvalidOperationException: NativeOverlapped cannot be reused for multiple operations after .NET 6 to .NET 8 upgrade
This manifests as a fatal exception in the http.sys "accept" loop, which can either:
Description
Apply mitigation and logging
Fixes #54251
Customer Impact
without fix, http.sys web-server stops taking traffic (best case) or segfaults
Regression?
believed to be a regression since .net 6; scenario is hard to repro reliably
Risk
This change is "fresh", and hasn't been validated in nightly (or even merged to "main"); the technical changes are minor (logging, improved error handling), and the competing behaviour is catastrophic.