Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsCloses #72984. Draft for now until we go through API review.
|
8791161 to
96dccbf
Compare
ManickaP
left a comment
There was a problem hiding this comment.
I know it's a draft, but I might not have time to review this properly later.
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicConfiguration.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicConfiguration.cs
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionOptions.cs
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionOptions.cs
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicListener.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionOptions.cs
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs
Outdated
Show resolved
Hide resolved
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| private readonly ValueTaskSource _connectedTcs = new ValueTaskSource(); | ||
| private readonly ValueTaskSource _shutdownTcs = new ValueTaskSource(); | ||
|
|
||
| private readonly CancellationTokenSource _shutdownCancellationTokenSource = new CancellationTokenSource(); |
There was a problem hiding this comment.
I think we might need to dispose _shutdownCancellationTokenSource?
Also, the naming confuses me... It implies the cancellation of the connection's shutdown, but it's not, it's for cancelling the handshake in the Listener, right? (and it also means it's not needed on the client side?)
There was a problem hiding this comment.
It is used only for listener to cancel the connection options callback if peer closes the connection before the handshake. I did not find a way to put the CTS outside QuicConnection.
I will try to come up with a better name
There was a problem hiding this comment.
What do we do in SslStream case? Do we also react and cancel user callback when the client kills handshake in the meantime?
There was a problem hiding this comment.
With sslstream we don't check for client-side activity while invoking the callback. We would have to always have a pending read on the inner stream and check for errors there. SslStream passes in the same token as to AuthenticateAsClientAsync.
There was a problem hiding this comment.
Renamed to ConnectionShutdownToken and added a comment
ManickaP
left a comment
There was a problem hiding this comment.
In general looks good. I think the last contentious thing is the _shutdownCancellationTokenSource.
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicConfiguration.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnectionOptions.cs
Show resolved
Hide resolved
| Exception exception = await AssertThrowsQuicExceptionAsync(QuicError.ConnectionTimeout, async () => await listener.AcceptConnectionAsync()); | ||
| Assert.Equal(SR.Format(SR.net_quic_handshake_timeout, QuicDefaults.HandshakeTimeout), exception.Message); | ||
| QuicClientConnectionOptions clientOptions = CreateQuicClientOptions(listener.LocalEndPoint); | ||
| clientOptions.HandshakeTimeout = clientShorterTimeout ? TimeSpan.FromSeconds(2) : TimeSpan.FromSeconds(20); |
There was a problem hiding this comment.
I'm pretty sure this will eventually pop-up in CI report. Especially if you're asserting specific types of exception that should happen only in certain order of events depending on this timing.
But we can wait until we see it.
| private readonly ValueTaskSource _connectedTcs = new ValueTaskSource(); | ||
| private readonly ValueTaskSource _shutdownTcs = new ValueTaskSource(); | ||
|
|
||
| private readonly CancellationTokenSource _shutdownCancellationTokenSource = new CancellationTokenSource(); |
There was a problem hiding this comment.
What do we do in SslStream case? Do we also react and cancel user callback when the client kills handshake in the meantime?
|
All CI failures are known build failures |
|
BTW, I assume this also fixes #70090 |
Closes #72984.
Closes #70090.
Adds:
The client times out as well.
Other improvements: