Skip to content

fix: implement Tuic.Close to release PoolClient resources#2713

Open
beck-8 wants to merge 1 commit intoMetaCubeX:Alphafrom
beck-8:fix/tuic-close
Open

fix: implement Tuic.Close to release PoolClient resources#2713
beck-8 wants to merge 1 commit intoMetaCubeX:Alphafrom
beck-8:fix/tuic-close

Conversation

@beck-8
Copy link
Copy Markdown

@beck-8 beck-8 commented Apr 15, 2026

Tuic outbound inherited the no-op Base.Close, so autoCloseProxyAdapter
could not cascade cleanup into the PoolClient. Every clientImpl (and its
SingleUse quic.Transport) then had to wait for its own closeClient
finalizer to run, a multi-cycle GC chain that delays release of the
listen/runSendQueue goroutines under rapid create/destroy workloads.

Add a public PoolClient.Close that closes every cached clientImpl, and
wire it up from Tuic.Close so the Close path is synchronous and does not
depend on GC.

@beck-8 beck-8 marked this pull request as draft April 15, 2026 11:00
Tuic outbound inherited the no-op Base.Close, so autoCloseProxyAdapter
could not cascade cleanup into the PoolClient. Every clientImpl (and its
SingleUse quic.Transport) then had to wait for its own closeClient
finalizer to run, a multi-cycle GC chain that delays release of the
listen/runSendQueue goroutines under rapid create/destroy workloads.

Add a public PoolClient.Close that closes every cached clientImpl, and
wire it up from Tuic.Close so the Close path is synchronous and does not
depend on GC.
@beck-8 beck-8 marked this pull request as ready for review April 15, 2026 12:48
@wwqgtxx wwqgtxx force-pushed the Alpha branch 2 times, most recently from 5a5e312 to 8d53952 Compare April 22, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant