Skip to content

Pass CancellationToken to WaitAsync in client #20210

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

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

BrennanConroy
Copy link
Member

Fixes #12882

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Mar 26, 2020
@BrennanConroy BrennanConroy added this to the 5.0.0-preview3 milestone Mar 26, 2020
@@ -601,7 +601,7 @@ async Task OnStreamCanceled(InvocationRequest irq)
var readers = default(Dictionary<string, object>);

CheckDisposed();
var connectionState = await _state.WaitForActiveConnectionAsync(nameof(StreamAsChannelCoreAsync));
var connectionState = await _state.WaitForActiveConnectionAsync(nameof(StreamAsChannelCoreAsync), token: cancellationToken);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove token = default from all of our internal methods that wait for the semaphore like WaitForActiveConnectionAsync, SendWithLock, WaitConnectionLockAsync, etc...?

I know WaitConnectionLockAsync in particular has a lot of usages where we don't want to use a cancellation token for close/reconnect logic, but I like being explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@analogrelay
Copy link
Contributor

Be aware, branching is underway. I think we can still get this in to preview3 but likely have to retarget.

@BrennanConroy BrennanConroy changed the base branch from master to release/5.0-preview3 March 30, 2020 23:55
@BrennanConroy
Copy link
Member Author

/azp run

@BrennanConroy
Copy link
Member Author

Switched base and re-running pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@analogrelay
Copy link
Contributor

@dotnet/aspnet-build @Pilchie are we OK to merge to preview3? We'd really like to get this in to preview3 if we can (it's not essential but would be nice to not have to wait a month ;)).

@Pilchie
Copy link
Member

Pilchie commented Mar 31, 2020

Go for it.

@analogrelay analogrelay merged commit 4cc328a into release/5.0-preview3 Mar 31, 2020
@analogrelay analogrelay deleted the brecon/cancellock branch March 31, 2020 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should respect cancellation token when waiting on connection lock.
4 participants