Skip to content

Conversation

Nukitt
Copy link
Contributor

@Nukitt Nukitt commented Oct 6, 2025

Previously, closing an already closed DRPC connection would lead to a panic.
panic: close of closed channel

This patch makes the closing of an already closed connection to be a no-op.

Epic: none
Release note: None

Previously, closing an already closed DRPC connection
would lead to a panic.
`panic: close of closed channel`

This patch makes the closing of an already closed connection
to be a no-op.

Epic: none
Release note: None
@Nukitt Nukitt requested a review from shubhamdhama October 6, 2025 09:09
@Nukitt Nukitt requested a review from a team as a code owner October 6, 2025 09:09
Copy link

blathers-crl bot commented Oct 6, 2025

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Comment on lines +141 to +147
select {
case <-c.Conn.Closed():
return nil // already closed
default:
_ = c.Conn.Close()
return c.pool.Close()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does Close() need to be concurrency safe?

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.

5 participants