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

[QUIC] MsQuicStream ctor code shuffles #55815

Closed
ManickaP opened this issue Jul 16, 2021 · 11 comments · Fixed by #57655
Closed

[QUIC] MsQuicStream ctor code shuffles #55815

ManickaP opened this issue Jul 16, 2021 · 11 comments · Fixed by #57655
Assignees
Labels
area-System.Net.Quic bug tenet-reliability Reliability/stability related issue (stress, load problems, etc.)
Milestone

Comments

@ManickaP
Copy link
Member

ManickaP commented Jul 16, 2021

We should move this before callback handler registration.

if (!connectionState.TryAddStream(this))
{
_state.StateGCHandle.Free();
throw new ObjectDisposedException(nameof(QuicConnection));
}

We should set it before SetCallbackHandlerDelegate since we can get CONNECTION_CLOSED event and that needs this.
If we want to prevent decrementing stream count, we should explicitely unset here.

The same applies to outbound ctor.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Net.Quic untriaged New issue has not been triaged by the area owner labels Jul 16, 2021
@ghost
Copy link

ghost commented Jul 16, 2021

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

Issue Details

We should move this before callback handler registration.

if (!connectionState.TryAddStream(this))
{
_state.StateGCHandle.Free();
throw new ObjectDisposedException(nameof(QuicConnection));
}

We should set it before SetCallbackHandlerDelegate since we can get CONNECTION_CLOSED event and that needs this.
If we want to prevent decrementing stream count, we should explicitely unset here.

Author: ManickaP
Assignees: -
Labels:

area-System.Net.Quic, untriaged

Milestone: -

@ManickaP ManickaP added this to the 7.0.0 milestone Jul 16, 2021
@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Jul 16, 2021
@ManickaP ManickaP mentioned this issue Jul 16, 2021
@karelz
Copy link
Member

karelz commented Aug 18, 2021

Failure:

Process terminated. Assertion failed.
Exception occurred during handling Stream SHUTDOWN_COMPLETE event: System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Net.Quic.Implementations.MsQuic.MsQuicStream.HandleEventConnectionClose(State state) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs:line 1368
   at System.Net.Quic.Implementations.MsQuic.MsQuicStream.HandleEventShutdownComplete(State state, StreamEvent& evt) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs:line 1024
   at System.Net.Quic.Implementations.MsQuic.MsQuicStream.HandleEvent(State state, StreamEvent& evt) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs:line 860
   at System.Net.Quic.Implementations.MsQuic.MsQuicStream.HandleEvent(State state, StreamEvent& evt) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs:line 860
   at System.Net.Quic.Implementations.MsQuic.MsQuicStream.NativeCallbackHandler(IntPtr stream, IntPtr context, StreamEvent& streamEvent) in /_/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs:line 824

Observed in PR #57598 - System.Net.Http.Functional.Tests on Fedora.34

@karelz
Copy link
Member

karelz commented Aug 18, 2021

It is unclear how often it shows up in CI -- we can't easily query Kusto for this :( ... bumping it to 6.0.
Per @CarnaViire it is simple fix. Given the (bad) impact on CI, we should try to get it in IMO ...

@karelz karelz modified the milestones: 7.0.0, 6.0.0 Aug 18, 2021
@CarnaViire CarnaViire self-assigned this Aug 18, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 18, 2021
@karelz
Copy link
Member

karelz commented Aug 19, 2021

Test failures 7/30-8/23 (incl. PRs):

Day Run Test suite
8/17 PR #57530 System.Net.Http.Functional.Tests
8/17 PR #57533 System.Net.Http.Functional.Tests
8/17 PR #57546 System.Net.Http.Functional.Tests
8/17 PR #57078 System.Net.Http.Functional.Tests
8/17 PR #57550 System.Net.Http.Functional.Tests
8/17 PR #57536 System.Net.Http.Functional.Tests
8/17 PR #57581 System.Net.Http.Functional.Tests
8/17 PR #57303 System.Net.Http.Functional.Tests
8/17 PR #57457 System.Net.Http.Functional.Tests
8/17 PR #57598 System.Net.Http.Functional.Tests
8/17 PR #56501 System.Net.Http.Functional.Tests
8/18 PR #51736 System.Net.Http.Functional.Tests
8/18 PR #57303 System.Net.Http.Functional.Tests
8/19 Fixed in main via PR #57655
8/19 PR #57700 - release/6.0 System.Net.Http.Functional.Tests
8/19 PR #57762 - release/6.0-rc1 System.Net.Http.Functional.Tests
8/20 PR #57765 - release/6.0 System.Net.Http.Functional.Tests
8/20 PR #57740 - release/6.0 System.Net.Http.Functional.Tests
8/20 PR #57834 - release/6.0 System.Net.Http.Functional.Tests
8/20 PR #57851 - release/6.0-rc1 System.Net.Http.Functional.Tests
8/23 Fixed in release/6.0 via PR #57742
8/25 2x PR #58059 - release/6.0-rc1
8/26 PR #58148 - release/6.0-rc1
8/27 PR #58271 - release/6.0-rc1
8/28 PR #58316 - release/6.0-rc1

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 19, 2021
CarnaViire added a commit that referenced this issue Aug 19, 2021
Moved ConnectionState assignment before msquic callback registration to avoid NRE in callback, in case Connection gets closed during Stream's ctor.

Fixes #55815
@karelz
Copy link
Member

karelz commented Aug 19, 2021

Given the frequency in CI, we should backport it to 6.0. Reopening to track that.
@CarnaViire can you please kick off the backport? Thanks!

@karelz karelz reopened this Aug 19, 2021
@karelz karelz added bug tenet-reliability Reliability/stability related issue (stress, load problems, etc.) labels Aug 19, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 20, 2021
@ViktorHofer
Copy link
Member

@karelz
Copy link
Member

karelz commented Aug 20, 2021

@ViktorHofer

Shouldn't we also backport into the rc1 branch?

Depends on appetite for RC1.
I assumed we are primarily trying to stabilize it. MsQuic is Preview only in 6.0 and the RC1 branch won't be used that much / long.
I let @danmoseley decide if he wants it to RC1 as well when he gets back on Monday.

@ViktorHofer
Copy link
Member

As long as the fix lands in any branch that will exist for the next few years I'm good. Was mostly curious about why RC1 vs RC2, stabilization of RC1 makes sense.

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 23, 2021
@karelz
Copy link
Member

karelz commented Aug 23, 2021

Fixed for 6.0 RC2 in release/6.0 branch in PR #57742
Fixed for 7.0 in PR #57655

@karelz karelz closed this as completed Aug 23, 2021
@ViktorHofer

This comment has been minimized.

@ViktorHofer

This comment has been minimized.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Quic bug tenet-reliability Reliability/stability related issue (stress, load problems, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants