commit 636469f555b0e95ed49cd30fcd0eb6136edff07b
parent 1d27558e39273f8c9d6547c9a842f3e00a40b570
Author: Joris Vink <joris@coders.se>
Date: Tue, 8 Sep 2020 11:51:06 +0200
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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;