fix panic: negative WaitGroup counter

avoid double wait group Done()

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2019-08-19 13:46:00 +03:00
parent 718ae42808
commit f1d08f251f

View File

@ -278,16 +278,13 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
delete(sockets, id)
mtx.Unlock()
// once done serving signal we're done
if s.wg != nil {
s.wg.Done()
}
}(id, psock)
// signal we're done
if s.wg != nil {
s.wg.Done()
}
}(id, psock)
}
}