Skip to content

Commit 331725a

Browse files
committed
Fix Abort lock
1 parent 325fc5a commit 331725a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,12 @@ public void Complete()
380380
}
381381

382382
_completed = true;
383-
AbortConnectionFlowControl();
384383
_outputWriter.Abort();
385384
}
385+
386+
// Ok to call after aborting the Pipe because we've already set _completed to true which means any writes from the abort call
387+
// won't call into the Pipe.
388+
AbortConnectionFlowControl();
386389
}
387390

388391
public Task ShutdownAsync()
@@ -925,6 +928,9 @@ private void ConsumeConnectionWindow(long bytes)
925928
}
926929
}
927930

931+
/// <summary>
932+
/// Do not call this method under the _writeLock
933+
/// </summary>
928934
private void AbortConnectionFlowControl()
929935
{
930936
lock (_windowUpdateLock)

0 commit comments

Comments
 (0)