Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,20 @@ public override async ValueTask DisposeAsync()
await stream.DisposeAsync().ConfigureAwait(false);
}

// We don't dispose the connection currently, because this causes races when the server connection is closed before
// the client has received and handled all response data.
// See discussion in https://github.com/dotnet/runtime/pull/57223#discussion_r687447832
#if false
// Dispose the connection
// If we already waited for graceful shutdown from the client, then the connection is already closed and this will simply release the handle.
// If not, then this will silently abort the connection.
_connection.Dispose();
await _connection.DisposeAsync();

// Dispose control streams so that we release their handles too.
await _inboundControlStream?.DisposeAsync().ConfigureAwait(false);
await _outboundControlStream?.DisposeAsync().ConfigureAwait(false);
#endif
if (_inboundControlStream is not null)
{
await _inboundControlStream.DisposeAsync().ConfigureAwait(false);
}
if (_outboundControlStream is not null)
{
await _outboundControlStream.DisposeAsync().ConfigureAwait(false);
}
}

public Task CloseAsync(long errorCode) => _connection.CloseAsync(errorCode).AsTask();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public async Task SetListenerTimeoutWorksWithSmallTimeout()
};

(QuicConnection clientConnection, QuicConnection serverConnection) = await CreateConnectedQuicConnection(null, listenerOptions);
await AssertThrowsQuicExceptionAsync(QuicError.ConnectionAborted, async () => await serverConnection.AcceptInboundStreamAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(100)));
await AssertThrowsQuicExceptionAsync(QuicError.ConnectionIdle, async () => await serverConnection.AcceptInboundStreamAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(100)));
await serverConnection.DisposeAsync();
await clientConnection.DisposeAsync();
}
Expand Down