Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuicConnection.OpenOutboundStreamAsync can hang indefinitely #101233

Closed
rzikm opened this issue Apr 18, 2024 · 2 comments · Fixed by #101250
Closed

QuicConnection.OpenOutboundStreamAsync can hang indefinitely #101233

rzikm opened this issue Apr 18, 2024 · 2 comments · Fixed by #101250
Assignees
Labels
area-System.Net.Quic tenet-reliability Reliability/stability related issue (stress, load problems, etc.)
Milestone

Comments

@rzikm
Copy link
Member

rzikm commented Apr 18, 2024

When starting a QuicStream, we call MsQuicStreamStart

internal ValueTask StartAsync(CancellationToken cancellationToken = default)
{
_startedTcs.TryInitialize(out ValueTask valueTask, this, cancellationToken);
{
unsafe
{
int status = MsQuicApi.Api.StreamStart(
_handle,
QUIC_STREAM_START_FLAGS.SHUTDOWN_ON_FAIL | QUIC_STREAM_START_FLAGS.INDICATE_PEER_ACCEPT);
if (ThrowHelper.TryGetStreamExceptionForMsQuicStatus(status, out Exception? exception))
{
_startedTcs.TrySetException(exception);
}
}
}
return valueTask;
}

TryGetStreamExceptionForMsQuicStatus attempts to classify the status code and behaves accordingly.

internal static bool TryGetStreamExceptionForMsQuicStatus(int status, [NotNullWhen(true)] out Exception? exception)
{
if (status == QUIC_STATUS_ABORTED)
{
// If status == QUIC_STATUS_ABORTED, we will receive an event later, which will complete the task source.
exception = null;
return false;
}

However, MsQuicStreamStart can return QUIC_STATUS_ABORTED, and in this case we will not receive any event because the stream is not considered started.

This may be the cause of some of the "The operation has timed out" CI failures.

@rzikm rzikm added tenet-reliability Reliability/stability related issue (stress, load problems, etc.) area-System.Net.Quic labels Apr 18, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Apr 18, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@rzikm rzikm added this to the 9.0.0 milestone Apr 18, 2024
@rzikm rzikm self-assigned this Apr 18, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Apr 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2024
@karelz
Copy link
Member

karelz commented Jun 24, 2024

Fixed in main (9.0) in PR #101250 and in 8.0.7 in PR #102147 (July release).

@karelz karelz modified the milestones: 9.0.0, 8.0.x Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Quic tenet-reliability Reliability/stability related issue (stress, load problems, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants