v1.3.109
v1.3.109
Bug Fixes
Fixed self-deadlock in IRC and Twitch adapter Close()
Both ircAdapter.Close() and twitchAdapter.Close() acquired the write lock
(a.mu.Lock()) and then called a.sendRaw("QUIT ..."), which internally
acquires a read lock (a.mu.RLock()). This is a self-deadlock in Go's
sync.RWMutex — the goroutine holds the write lock and blocks forever waiting
to acquire the read lock.
Impact: Every time the IRC or Twitch adapter was stopped while connected,
the Close() call would hang indefinitely, leaking the goroutine and leaving the
connection open.
Fix: Capture the connection reference under the lock, release the lock, then
send QUIT and close the connection outside the lock.