Closed MihaZupan closed 4 months ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | MihaZupan |
---|---|
Assignees: | - |
Labels: | `bug`, `area-System.Net.Quic` |
Milestone: | - |
I can confirm this with entirely different project.
The application seems to work fine however.
Triage: we should fix this in 8.0.
Just wanted to confirm given https://github.com/dotnet/runtime/issues/80111#issuecomment-1405296246, was this moved to 9.0.0 intentionally?
Yes, it was moved. Unfortunately, we didn't have a chance to look into it. And as this doesn't affect application behavior, it got lower priority. It's annoying, but not detrimental.
Looks like this is already fixed by some changes, can't repro it on main. @MihaZupan can you repro this on main?
I can consistently repro on 8, but wasn't able to on 9.0 anymore. Might have been fixed recently, closing. Feel free to reopen if anyone's still seeing it.
Doing a simple HTTP test run
.dotnet/dotnet build .\src\libraries\System.Net.Http\tests\FunctionalTests\ /t:Test
while watching for unobserved exceptions
[Fact]
public async Task WatchForUnobserved()
{
bool seenUnobservedExceptions = false;
EventHandler<UnobservedTaskExceptionEventArgs> eventHandler = (_, e) =>
{
_output.WriteLine(e.Exception.ToString());
seenUnobservedExceptions = true;
};
TaskScheduler.UnobservedTaskException += eventHandler;
await Task.Delay(10_000);
TaskScheduler.UnobservedTaskException -= eventHandler;
Assert.False(seenUnobservedExceptions);
}
I'm still seeing 100s of such unobserved exceptions (mainly from Quic):
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Cannot access a disposed object.
Object name: 'System.Net.Quic.QuicConnection'.)
---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Quic.QuicConnection'.
at System.Net.Quic.QuicConnection.HandleEventShutdownComplete() in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 652
at System.Net.Quic.QuicConnection.HandleConnectionEvent(QUIC_CONNECTION_EVENT& connectionEvent) in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 738
at System.Net.Quic.QuicConnection.NativeCallback(QUIC_HANDLE* connection, Void* context, QUIC_CONNECTION_EVENT* connectionEvent) in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 771
--- End of stack trace from previous location ---
System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Operation aborted.)
---> System.Net.Quic.QuicException: Operation aborted.
at System.Net.Quic.QuicConnection.HandleEventShutdownComplete() in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 652
at System.Net.Quic.QuicConnection.HandleConnectionEvent(QUIC_CONNECTION_EVENT& connectionEvent) in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 738
at System.Net.Quic.QuicConnection.NativeCallback(QUIC_HANDLE* connection, Void* context, QUIC_CONNECTION_EVENT* connectionEvent) in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 771
--- End of stack trace from previous location ---
at System.Net.Quic.QuicConnection.AcceptInboundStreamAsync(CancellationToken cancellationToken) in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Quic\src\System\Net\Quic\QuicConnection.cs:line 565
at System.Net.Http.Http3Connection.AcceptStreamsAsync() in C:\MihaZupan\runtime-debug\src\libraries\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\Http3Connection.cs:line 523
--- End of inner exception stack trace ---
I have a console app with HttpClient that continuously sends requests to a localhost Kestrel instance. If I randomly shut down and restart the server while HttpClient is making requests, I can see sporadic
UnobservedTaskException
s coming fromSystem.Net.Quic
.