fixed deadlock risk, cleaned up tests

This commit is contained in:
Jay
2026-06-06 20:09:05 -04:00
parent 08d2ff3317
commit fe119b3f36
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -368,11 +368,11 @@ func (p *Pool) Connect(id string, opts ...ConnectOption) error {
InboxCounter: p.inboxCounter,
Retire: func(err error) {
p.mu.Lock()
defer p.mu.Unlock()
if p.closed {
return
}
delete(p.peers, id)
p.mu.Unlock()
p.events <- PoolEvent{ID: id, Kind: EventRetired, Err: err, At: time.Now()}
},
}