-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.Net.Quicbugdisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issue
Milestone
Description
I found this while investigating pre-cancelled writes for #32077
This might be a result of a race condition, because I can see exception being set to ResettableCompletionSource, but it is not propagated to Read call.
It reproduces for me on this
[Fact]
public async Task StreamAbortedWithoutWriting_ReadThrows()
{
long expectedErrorCode = 1234;
await RunClientServer(
clientFunction: async connection =>
{
await using QuicStream stream = connection.OpenUnidirectionalStream();
stream.AbortWrite(expectedErrorCode);
await stream.ShutdownCompleted();
},
serverFunction: async connection =>
{
await using QuicStream stream = await connection.AcceptStreamAsync();
byte[] buffer = new byte[1];
// this assert fails (no exception was thrown)
QuicStreamAbortedException ex = await Assert.ThrowsAsync<QuicStreamAbortedException>(() => ReadAll(stream, buffer));
Assert.Equal(expectedErrorCode, ex.ErrorCode);
await stream.ShutdownCompleted();
}
);
}If I write anything to stream before aborting it, exception is thrown as expected.
I have just reproduced it after writing too.
I suspect it might be fixed by #52929 because @scalablecory mentioned fixing some race conditions for read state.
Metadata
Metadata
Assignees
Labels
area-System.Net.Quicbugdisabled-testThe test is disabled in source code against the issueThe test is disabled in source code against the issue