diff options
Diffstat (limited to 'pkg')
-rwxr-xr-x | pkg/pool/static_pool.go | 4 | ||||
-rw-r--r-- | pkg/pool/supervisor_test.go | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/pkg/pool/static_pool.go b/pkg/pool/static_pool.go index 051e7a8a..b20e4242 100755 --- a/pkg/pool/static_pool.go +++ b/pkg/pool/static_pool.go @@ -272,7 +272,9 @@ func defaultErrEncoder(sp *StaticPool) ErrorEncoder { w.State().Set(worker.StateInvalid) sp.events.Push(events.PoolEvent{Event: events.EventWorkerDestruct, Payload: w}) - errS := w.Stop() + // kill worker instead of stop, because worker here might be in the broken state (network) which leads us + // to the error + errS := w.Kill() if errS != nil { return nil, errors.E(op, err, errS) } diff --git a/pkg/pool/supervisor_test.go b/pkg/pool/supervisor_test.go index 0702a71f..39d8abb1 100644 --- a/pkg/pool/supervisor_test.go +++ b/pkg/pool/supervisor_test.go @@ -39,6 +39,8 @@ func TestSupervisedPool_Exec(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, p) + time.Sleep(time.Second) + pidBefore := p.Workers()[0].Pid() for i := 0; i < 100; i++ { |