Skip to content

QuicConnection not being released after exception #87291

@amcasey

Description

@amcasey

Description

The context is best explained by the thread of comments in the original PR but, to summarize, the aspnetcore test QuicConnectionListenerTests.AcceptAsync_NoCertificateCallback_RemovedFromPendingConnections started failing when we picked up #87057, which revealed a pre-existing bug - a QuicConnection that apparently keeps itself alive, preventing Kestrel's ConditionalWeakTable (referred to as CWT in the test) from being cleared, even though an exception prevented the connection.

@BrennanConroy goes into more detail here.

Reproduction Steps

QuicConnectionListenerTests.AcceptAsync_NoCertificateCallback_RemovedFromPendingConnections shows the failure, though there's probably a simpler repro.

Expected behavior

The QuicConnection is finalized and removed from aspnetcore's ConditionalWeakTable.

Actual behavior

The QuicConnection is still rooted by a GC handle.

Regression?

It predates the insertion, but we don't know by how much.

Known Workarounds

No response

Configuration

The PR has commit SHAs for both repos, but it's basically main as of 2023-06-08.

Other information

There's a tracking bug here for any compensating work required in aspnetcore.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions