mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
sentry/socket: don't release a connected enpoint under the endpoint mutex
It isn't required and can have side effects. For example, the current endpoint can be in an SCM message that is queued to the connected endpoint. PiperOrigin-RevId: 447906621
This commit is contained in:
@@ -59,10 +59,8 @@ func (e *connectionlessEndpoint) isBound() bool {
|
||||
// with it.
|
||||
func (e *connectionlessEndpoint) Close(ctx context.Context) {
|
||||
e.Lock()
|
||||
if e.connected != nil {
|
||||
e.connected.Release(ctx)
|
||||
e.connected = nil
|
||||
}
|
||||
connected := e.connected
|
||||
e.connected = nil
|
||||
|
||||
if e.isBound() {
|
||||
e.path = ""
|
||||
@@ -73,6 +71,9 @@ func (e *connectionlessEndpoint) Close(ctx context.Context) {
|
||||
e.receiver = nil
|
||||
e.Unlock()
|
||||
|
||||
if connected != nil {
|
||||
connected.Release(ctx)
|
||||
}
|
||||
r.CloseNotify()
|
||||
r.Release(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user