From 174ec739bbe770b41b265f947abf29315f7a5921 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Fri, 20 Nov 2015 00:30:08 +0000 Subject: [PATCH] Don't log ODEs thrown from _abortedCts.Cancel --- src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs index 8156706197..3922f4d9d7 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs @@ -199,7 +199,15 @@ namespace Microsoft.AspNet.Server.Kestrel.Http ConnectionControl.End(ProduceEndType.SocketDisconnect); SocketInput.AbortAwaiting(); - _abortedCts?.Cancel(); + try + { + _abortedCts?.Cancel(); + } + catch (ObjectDisposedException) + { + // Don't log ODEs thrown from _abortedCts.Cancel() + // If _abortedCts is disposed, the app has already completed. + } } catch (Exception ex) {