Skip to content

Commit b076b7d

Browse files
committed
some updates
1 parent cebb459 commit b076b7d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public void UpdateMaxFrameSize(uint maxFrameSize)
371371
}
372372

373373
/// <summary>
374-
/// Call while in the <c>_writeLock</c>.
374+
/// Call while in the <see cref="_writeLock"/>.
375375
/// </summary>
376376
/// <returns><c>true</c> if already completed.</returns>
377377
private bool CompleteUnsynchronized()
@@ -397,8 +397,8 @@ public void Complete()
397397
}
398398
}
399399

400-
// Ok to call after aborting the Pipe because we've already set _completed to true which means any writes from the abort call
401-
// won't call into the Pipe.
400+
// Call outside of _writeLock as this can call Http2OutputProducer.Stop which can acquire Http2OutputProducer._dataWriterLock
401+
// which is not the desired lock order
402402
AbortConnectionFlowControl();
403403
}
404404

@@ -426,6 +426,10 @@ public void Abort(ConnectionAbortedException error)
426426
return;
427427
}
428428
}
429+
430+
// Call outside of _writeLock as this can call Http2OutputProducer.Stop which can acquire Http2OutputProducer._dataWriterLock
431+
// which is not the desired lock order
432+
AbortConnectionFlowControl();
429433
}
430434

431435
private ValueTask<FlushResult> FlushEndOfStreamHeadersAsync(Http2Stream stream)
@@ -946,7 +950,9 @@ private void ConsumeConnectionWindow(long bytes)
946950
}
947951

948952
/// <summary>
949-
/// Do not call this method under the _writeLock
953+
/// Do not call this method under the _writeLock.
954+
/// This method can call Http2OutputProducer.Stop which can acquire Http2OutputProducer._dataWriterLock
955+
/// which is not the desired lock order
950956
/// </summary>
951957
private void AbortConnectionFlowControl()
952958
{

0 commit comments

Comments
 (0)