Skip to content

Commit 53b6815

Browse files
qingyang-humatthewdale
authored andcommitted
GODRIVER-2730 Remove blocking channel in update recovering. (#1196)
1 parent 0ffab78 commit 53b6815

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

x/mongo/driver/topology/server.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,11 @@ func (s *Server) update() {
473473
checkNow := s.checkNow
474474
done := s.done
475475

476-
var doneOnce bool
477476
defer func() {
478-
if r := recover(); r != nil {
479-
if doneOnce {
480-
return
481-
}
482-
// We keep this goroutine alive attempting to read from the done channel.
483-
<-done
484-
}
477+
_ = recover()
485478
}()
486479

487480
closeServer := func() {
488-
doneOnce = true
489481
s.subLock.Lock()
490482
for id, c := range s.subscribers {
491483
close(c)

0 commit comments

Comments
 (0)