summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pool.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pool.go b/pool.go
index dfa7ab1b..86320baa 100644
--- a/pool.go
+++ b/pool.go
@@ -178,6 +178,11 @@ func (p *Pool) replaceWorker(w *Worker, caused interface{}) {
if nw, err := p.createWorker(); err != nil {
p.throw(EventError, w, err)
+
+ if len(p.Workers()) == 0 {
+ // possible situation when major error causes all PHP scripts to die (for example dead DB)
+ p.throw(EventError, nil, fmt.Errorf("all workers dead"))
+ }
} else {
p.free <- nw
}