Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/rpc/drpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,13 @@ type closeEntirePoolConn struct {
}

func (c *closeEntirePoolConn) Close() error {
_ = c.Conn.Close()
return c.pool.Close()
select {
case <-c.Conn.Closed():
return nil // already closed
default:
_ = c.Conn.Close()
return c.pool.Close()
}
Comment on lines +141 to +147
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?

}

type DRPCConnection = Connection[drpc.Conn]
Expand Down