Skip to content

Commit

Permalink
Fix bogus active counting for procs terminating due to down-scaling
Browse files Browse the repository at this point in the history
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)

(cherry picked from commit e982e90)
  • Loading branch information
bogdan-iancu committed Sep 20, 2024
1 parent 4d79a71 commit b9ba6a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit b9ba6a2

Please sign in to comment.