You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix data race in SessionCommon Close() and Ping() methods
Protect concurrent access to sm.yamux and sm.smux fields with sm.mutx lock to prevent data races when Close() or Ping() are called while session is being initialized.
The race occurred when:
- handleSession() writes to dSes.sm.yamux (server.go:242) while holding the lock
- Close() reads sc.sm.yamux (session_common.go:187-188) without holding the lock
- A goroutine can call Close() concurrently during session setup
Changes:
- Add sm.mutx.Lock() protection in Close() method
- Add sm.mutx.RLock() protection in Ping() method for consistency
💘 Generated with Crush
Co-Authored-By: Crush <[email protected]>
0 commit comments