From 5db6394769e229139cbf8538ec73253ce76e735b Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Fri, 9 Nov 2018 12:40:51 -0800 Subject: [PATCH] Always decrement count on HTTP/2 stream completion (#3087) #3079 --- src/Kestrel.Core/Internal/Http2/Http2Connection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kestrel.Core/Internal/Http2/Http2Connection.cs b/src/Kestrel.Core/Internal/Http2/Http2Connection.cs index abb2ec13e1..a000db38c1 100644 --- a/src/Kestrel.Core/Internal/Http2/Http2Connection.cs +++ b/src/Kestrel.Core/Internal/Http2/Http2Connection.cs @@ -1045,11 +1045,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 { lock (_stateLock) { + _activeStreamCount--; + // Get, Add, Remove so the steam is always registered in at least one collection at a time. if (_streams.TryGetValue(streamId, out var stream)) { - _activeStreamCount--; - if (stream.IsDraining) { stream.DrainExpiration =