Skip to content

Fix race with CTS disposing #11757

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 6 commits into from
Oct 25, 2019
Merged

Fix race with CTS disposing #11757

merged 6 commits into from
Oct 25, 2019

Conversation

BrennanConroy
Copy link
Member

Fixes https://github.com/aspnet/AspNetCore-Internal/issues/2293

DisposeAsync will dispose the CTS and then set it to null, however we could still try to cancel it between the dispose and the null resulting in ODE.

Couldn't think of a great way to do this without locking, but it shouldn't be a contested lock so it's fine.

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Jul 1, 2019
@BrennanConroy BrennanConroy requested a review from davidfowl July 1, 2019 18:08
Copy link
Contributor

@mikaelm12 mikaelm12 left a comment

Choose a reason for hiding this comment

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

Let's see if this fixes the ODE

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

We need to keep the _statLock until the HttpConnectionContext is put into a state where it's impossible to have the Cancellation CTS disposed from underneath us.

@analogrelay analogrelay added this to the 3.0.0-preview8 milestone Jul 2, 2019
@analogrelay analogrelay added the tell-mode Indicates a PR which is being merged during tell-mode label Jul 23, 2019
@BrennanConroy
Copy link
Member Author

Ping, I modified this a little since when it was approved.

Had to do some ugly test hackery to try to make the test do what it claimed to be doing.

@BrennanConroy BrennanConroy removed this from the 3.0.0-preview8 milestone Aug 13, 2019
@BrennanConroy BrennanConroy removed the tell-mode Indicates a PR which is being merged during tell-mode label Aug 13, 2019
@analogrelay analogrelay added this to the 5.0.0-alpha1 milestone Aug 13, 2019
@BrennanConroy
Copy link
Member Author

/azp run all

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@BrennanConroy BrennanConroy changed the base branch from master to release/3.1 October 17, 2019 20:40
@BrennanConroy BrennanConroy requested review from halter73 and removed request for SteveSandersonMS, Tratcher, dougbu, jkotalik and a team October 17, 2019 20:40
@analogrelay analogrelay added the * NO MERGE * Do not merge this PR as long as this label is present. label Oct 23, 2019
@analogrelay
Copy link
Contributor

@BrennanConroy do you want to try and get this in today for preview 2? Assuming not (because of the milestone) I've labeled this "NO MERGE" so we hold off on merging until the branch is open for preview 3 changes.

@BrennanConroy
Copy link
Member Author

I don't want to rush it, but it would be nice to fix in 3.1. Fixes most LongPolling tests from being flaky

@analogrelay
Copy link
Contributor

Cool. I believe we stay in M2 approval for Preview 3 so let's bring it up then. Especially if it reduces test flakiness :).

@analogrelay analogrelay removed the * NO MERGE * Do not merge this PR as long as this label is present. label Oct 24, 2019
@analogrelay
Copy link
Contributor

Branches are open again for preview 3 work, but this PR does still need @Pilchie approval before merging.

@Pilchie
Copy link
Member

Pilchie commented Oct 25, 2019

Approved for 3.1 Preview 3. Thanks @BrennanConroy.

@BrennanConroy BrennanConroy merged commit e40b218 into release/3.1 Oct 25, 2019
@BrennanConroy BrennanConroy deleted the brecon/lpRace branch October 25, 2019 03:54
ryanbrandenburg pushed a commit that referenced this pull request Oct 25, 2019
* [release/3.1] Update dependencies from 3 repositories (#15218)

* Update dependencies from https://github.com/dotnet/arcade build 20191017.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19517.3
- Microsoft.DotNet.GenAPI - 1.0.0-beta.19517.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19517.3

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.2

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.2
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.2
- dotnet-ef - 3.1.0-preview2.19521.2
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.2
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.2
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.2
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.2

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.4

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.4
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.4
- dotnet-ef - 3.1.0-preview2.19521.4
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.4
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.4
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.4
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.4

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.5

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.5
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.5
- dotnet-ef - 3.1.0-preview2.19521.5
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.5
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.5
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.5
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.5

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.7

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.7
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.7
- dotnet-ef - 3.1.0-preview2.19521.7
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.7
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.7
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.7
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.7

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.8

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.8
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.8
- dotnet-ef - 3.1.0-preview2.19521.8
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.8
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.8
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.8
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.8

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.9

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.9
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.9
- dotnet-ef - 3.1.0-preview2.19521.9
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.9
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.9
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.9
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.9

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.11

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.11
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.11
- dotnet-ef - 3.1.0-preview2.19521.11
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.11
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.11
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.11
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.11

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.12

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.12
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.12
- dotnet-ef - 3.1.0-preview2.19521.12
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.12
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.12
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.12
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.12

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191021.13

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19521.13
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19521.13
- dotnet-ef - 3.1.0-preview2.19521.13
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19521.13
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19521.13
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19521.13
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19521.13

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191022.1

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19522.1
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19522.1
- dotnet-ef - 3.1.0-preview2.19522.1
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19522.1
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19522.1
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19522.1
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19522.1

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191022.3

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19522.3
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19522.3
- dotnet-ef - 3.1.0-preview2.19522.3
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19522.3
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19522.3
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19522.3
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19522.3

* Remove duplicate icon url

* Remove more duplicate icon elements

* Remove more package icons

* Remove packageIcon

* Update dependencies from https://github.com/aspnet/Blazor build 20191023.1

- Microsoft.AspNetCore.Blazor.Mono - 3.1.0-preview2.19523.1

* Undo bad deletion of eng/common file

* Update dependencies from https://github.com/aspnet/AspNetCore-Tooling build 20191023.2

- Microsoft.AspNetCore.Mvc.Razor.Extensions - 3.1.0-preview2.19523.2
- Microsoft.AspNetCore.Razor.Language - 3.1.0-preview2.19523.2
- Microsoft.CodeAnalysis.Razor - 3.1.0-preview2.19523.2
- Microsoft.NET.Sdk.Razor - 3.1.0-preview2.19523.2

* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20191023.7

- Microsoft.EntityFrameworkCore.Tools - 3.1.0-preview2.19523.7
- Microsoft.EntityFrameworkCore.SqlServer - 3.1.0-preview2.19523.7
- dotnet-ef - 3.1.0-preview2.19523.7
- Microsoft.EntityFrameworkCore - 3.1.0-preview2.19523.7
- Microsoft.EntityFrameworkCore.InMemory - 3.1.0-preview2.19523.7
- Microsoft.EntityFrameworkCore.Relational - 3.1.0-preview2.19523.7
- Microsoft.EntityFrameworkCore.Sqlite - 3.1.0-preview2.19523.7

* [ApiAuth] Fix subscription callbacks when unsubscribe (#15194)

re-assigned the callback array to itself after running splice on it when a client unsubscribed from notifications.

* Update doc references in Auth action results (#15110)

* Rebrand for 3.1.0-preview3

- aspnet/AspNetCore-Internal#3281

* [Templating][Fixes #15349] Update SPA templates to use generic host (#15365)

* [Blazor] Reliability improvements for the E2E tests (#15320)

* Fix race with CTS disposing (#11757)

* Nuke helix arm runs on 3.1 (#15390)

* [Blazor][Fixes #14959] NavLink match should be case-insensitive (#15401)
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants