Skip to content

Conversation

@bradfitz
Copy link
Member

@bradfitz bradfitz commented Oct 3, 2025

In the earlier http2 package migration (1d93bdc, #17394) I had
removed Direct.Close's tracking of the connPool, thinking it wasn't
necessary.

Some tests (in another repo) are strict and like it to tear down the
world and wait, to check for leaked goroutines. And they caught this
letting some goroutines idle past Close, even if they'd eventually
close down on their own.

This restores the connPool accounting and the aggressife close.

Updates #17305
Updates #17394

In the earlier http2 package migration (1d93bdc, #17394) I had
removed Direct.Close's tracking of the connPool, thinking it wasn't
necessary.

Some tests (in another repo) are strict and like it to tear down the
world and wait, to check for leaked goroutines. And they caught this
letting some goroutines idle past Close, even if they'd eventually
close down on their own.

This restores the connPool accounting and the aggressife close.

Updates #17305
Updates #17394

Change-Id: I5fed283a179ff7c3e2be104836bbe58b05130cc7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz bradfitz requested review from a team, andrew-d, awly and creachadair October 3, 2025 01:34
Copy link
Member

@creachadair creachadair left a comment

Choose a reason for hiding this comment

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

After multiple reads-through each disproving to myself a way in which the lock handling was incorrect, I am fairly convinced this works, but I rate a distinct possibility I missed something 😅


ncc := NewConn(clientConn.Conn)

nc.mu.Lock()
Copy link
Member

Choose a reason for hiding this comment

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

The lock discipline here is not new, but is very cursed. 😭

Copy link
Member Author

Choose a reason for hiding this comment

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

hey, compared to LocalBackend this is straight up normal

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure why there's a defer there, though, before the return. Kinda useless.

Copy link
Member

@creachadair creachadair Oct 3, 2025

Choose a reason for hiding this comment

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

hey, compared to LocalBackend this is straight up normal

You're absolutely right but that is a very very low bar 😂

@bradfitz bradfitz merged commit 206d98e into main Oct 3, 2025
57 checks passed
@bradfitz bradfitz deleted the bradfitz/h2_close branch October 3, 2025 03:50
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.

2 participants