Fix more races
@@ -331,11 +331,14 @@ func (s *Service) Start() error {
// Close closes the service.
func (s *Service) Close() {
s.stmtQueue.Close()
+
select {
case <-s.queueDone:
default:
close(s.closeCh)
}
+ <-s.queueDone
+
s.ln.Close()
return
}
