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: serialize killchannel map access to prevent concurrent-map race
killchannel (map[string]chan bool) was read, written and deleted from both HTTP
request goroutines (Connect/Disconnect/logout/admin-delete) and the per-session
startClient goroutine with no synchronization, which can crash the process with
"concurrent map read and map write" / "concurrent map writes" under simultaneous
connects.
Guard every map operation with a dedicated mutex via four helpers
(setKillChannel / getKillChannel / deleteKillChannel / signalKill). The lock is
held only around the map access, never while sending on or receiving from a
channel, so a slow or absent receiver cannot block another session. The
startClient loop now reads its channel through getKillChannel each iteration
instead of indexing the map directly. Behaviour is otherwise unchanged; this
complements the buffered-channel fix from #242.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments