Skip to content

Conversation

@wfurt
Copy link
Member

@wfurt wfurt commented Jun 15, 2021

This is follow-up on #52800
When we throw in MsQuicStream, the finalizer would still run and that would call Dispose() and that would try to decrement StreamCount and we may hit Debug.Assert on negative number for stream we never added.
Since the Dispose is already using _state.ConnectionState?.RemoveStream(this); the fix is to defer assignment of ConnectionState until after TryAddStream is successfully finished.

enabling two more tests #52800 missed.

@ghost
Copy link

ghost commented Jun 15, 2021

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

Issue Details

This is follow-up on #52800
When we throw in MsQuicStream, the finalizer would still run and that would call Dispose() and that would try to decrement StreamCount and we may hit Debug.Assert on negative number for stream we never added.
Since the Dispose is already using _state.ConnectionState?.RemoveStream(this); the fix is to defer assignment of ConnectionState until after TryAddStream is successfully finished.

enabling two more tests #52800 missed.

Author: wfurt
Assignees: wfurt
Labels:

area-System.Net.Quic

Milestone: -

@wfurt wfurt merged commit 472f11c into dotnet:main Jun 18, 2021
@wfurt wfurt deleted the cleanup_52048 branch June 18, 2021 07:00
@karelz karelz added this to the 6.0.0 milestone Jul 15, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants