summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-02-08 01:09:17 +0300
committerValery Piashchynski <[email protected]>2021-02-08 01:09:17 +0300
commit3e92e3df723ca1c4f152d8526eebfd7184e6fcec (patch)
treecda1f4b7dafd5516c8a12b593a5b4e7d2f445f56 /pkg
parentd353bc5f0be991ad44208e48ed04dc61ee53c340 (diff)
Push worker to the stack typo
Diffstat (limited to 'pkg')
-rwxr-xr-xpkg/pool/static_pool_test.go2
-rwxr-xr-xpkg/worker_watcher/worker_watcher.go4
2 files changed, 5 insertions, 1 deletions
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 {