summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/server.go b/server.go
index 16c9d39f..7bf041e8 100644
--- a/server.go
+++ b/server.go
@@ -176,6 +176,13 @@ func (srv *Server) poolObserver(event int, ctx interface{}) {
if event == EventPoolError {
// pool failure, rebuilding
if err := srv.Reset(); err != nil {
+ srv.mu.Lock()
+ defer srv.mu.Unlock()
+
+ srv.started = false
+ srv.pool = nil
+ srv.factory = nil
+
// everything is dead
srv.throw(EventServerFailure, srv)
}