diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 2a649b9a13501..9e506f7089c4d 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1973,6 +1973,8 @@ consult the installation file that came with this distribution, or visit \n\ fpm_stdio_flush_child(); + fpm_request_shutdown(); + requests++; if (UNEXPECTED(max_requests && (requests == max_requests))) { fcgi_request_set_keep(request, 0); diff --git a/sapi/fpm/fpm/fpm_request.c b/sapi/fpm/fpm/fpm_request.c index 9ea7d8aeaaa35..ae8711981713d 100644 --- a/sapi/fpm/fpm/fpm_request.c +++ b/sapi/fpm/fpm/fpm_request.c @@ -54,8 +54,8 @@ void fpm_request_accepting(void) proc->tv = now; fpm_scoreboard_proc_release(proc); - /* idle++, active-- */ - fpm_scoreboard_update_commit(1, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + /* idle++ */ + fpm_scoreboard_update_commit(1, 0, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); } void fpm_request_reading_headers(void) @@ -220,6 +220,12 @@ void fpm_request_finished(void) fpm_scoreboard_proc_release(proc); } +void fpm_request_shutdown(void) +{ + /* active-- */ + fpm_scoreboard_update(0, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); +} + void fpm_request_check_timed_out(struct fpm_child_s *child, struct timeval *now, int terminate_timeout, int slowlog_timeout, int track_finished) /* {{{ */ { struct fpm_scoreboard_proc_s proc, *proc_p; diff --git a/sapi/fpm/fpm/fpm_request.h b/sapi/fpm/fpm/fpm_request.h index 1dcc7f78902fc..aa6e6e5e422cc 100644 --- a/sapi/fpm/fpm/fpm_request.h +++ b/sapi/fpm/fpm/fpm_request.h @@ -15,6 +15,8 @@ void fpm_request_executing(void); void fpm_request_end(void); /* request processed: cleaning current request */ void fpm_request_finished(void); +/* request post shutdown: decrement active */ +void fpm_request_shutdown(void); struct fpm_child_s; struct timeval;