From 3e92e3df723ca1c4f152d8526eebfd7184e6fcec Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Mon, 8 Feb 2021 01:09:17 +0300 Subject: Push worker to the stack typo --- pkg/pool/static_pool_test.go | 2 +- pkg/worker_watcher/worker_watcher.go | 4 ++++ rr | Bin 32768 -> 0 bytes 3 files changed, 5 insertions(+), 1 deletion(-) delete mode 100755 rr diff --git a/pkg/pool/static_pool_test.go b/pkg/pool/static_pool_test.go index 65e10119..6ffb05b3 100755 --- a/pkg/pool/static_pool_test.go +++ b/pkg/pool/static_pool_test.go @@ -454,7 +454,7 @@ func Test_Static_Pool_Handle_Dead(t *testing.T) { pipe.NewPipeFactory(), Config{ NumWorkers: 5, - AllocateTimeout: time.Second, + AllocateTimeout: time.Second * 100, DestroyTimeout: time.Second, }, ) diff --git a/pkg/worker_watcher/worker_watcher.go b/pkg/worker_watcher/worker_watcher.go index 1e229d9d..d065bae5 100755 --- a/pkg/worker_watcher/worker_watcher.go +++ b/pkg/worker_watcher/worker_watcher.go @@ -54,6 +54,10 @@ func (ww *workerWatcher) Get(ctx context.Context) (worker.SyncWorker, error) { } // ========================================================= // SLOW PATH + // Put worker back (no matter it's state, it will be killed next) + if w != nil { + ww.stack.Push(w) + } // no free workers in the stack // try to continuously get free one for { diff --git a/rr b/rr deleted file mode 100755 index 8a7ac396..00000000 Binary files a/rr and /dev/null differ -- cgit v1.2.3