Skip to content

Commit 174ec73

Browse files
committed
Don't log ODEs thrown from _abortedCts.Cancel
1 parent 3c7431a commit 174ec73

File tree

1 file changed

+9
-1
lines changed
  • src/Microsoft.AspNet.Server.Kestrel/Http

1 file changed

+9
-1
lines changed

src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,15 @@ public void Abort()
199199
ConnectionControl.End(ProduceEndType.SocketDisconnect);
200200
SocketInput.AbortAwaiting();
201201

202-
_abortedCts?.Cancel();
202+
try
203+
{
204+
_abortedCts?.Cancel();
205+
}
206+
catch (ObjectDisposedException)
207+
{
208+
// Don't log ODEs thrown from _abortedCts.Cancel()
209+
// If _abortedCts is disposed, the app has already completed.
210+
}
203211
}
204212
catch (Exception ex)
205213
{

0 commit comments

Comments
 (0)