From e982e90b4a7ccab0dfcff3628566359fb0ab0539 Mon Sep 17 00:00:00 2001 From: Bogdan-Andrei Iancu Date: Fri, 20 Sep 2024 12:03:48 +0300 Subject: [PATCH] Fix bogus active counting for procs terminating due to down-scaling Be sure to mark the proc as idel before actually doing "exit()", otherwise we will count it as busy for the whole time the proc is terminated by OS (we automatically clear the load stats only upon sigchild on attendant) --- pt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pt.c b/pt.c index 0e68c6bbef1..05d208e3b10 100644 --- a/pt.c +++ b/pt.c @@ -490,6 +490,8 @@ void dynamic_process_final_exit(void) /* if a TCP proc by chance, reset the tcp-related data */ tcp_reset_worker_slot(); + pt_become_idle(); + /* mark myself as DYNAMIC (just in case) to have an err-less termination */ pt[process_no].flags |= OSS_PROC_SELFEXIT; LM_INFO("doing self termination\n");