From 636469f555b0e95ed49cd30fcd0eb6136edff07b Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Tue, 8 Sep 2020 11:51:06 +0200 Subject: [PATCH] Only reset accept_avail if we grabbed the lock. Otherwise in certain scenarios it could mean that workers unsuccessfully grabbed the lock, reset accept_avail and no longer attempt to grab the lock afterwards. This can cause a complete stall in workers processing requests. --- src/worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker.c b/src/worker.c index cc6f27a..ccb5e03 100644 --- a/src/worker.c +++ b/src/worker.c @@ -453,8 +453,8 @@ kore_worker_entry(struct kore_worker *kw) } if (!worker->has_lock && accept_avail) { - accept_avail = 0; if (worker_acceptlock_obtain()) { + accept_avail = 0; if (had_lock == 0) { kore_platform_enable_accept(); had_lock = 1;