Skip to content

Commit

Permalink
* H2MinWorker is reduced automatically to 1 during graceful shutdown
Browse files Browse the repository at this point in the history
   of a child process (e.g. server reload). This lets all ongoing requests
   continue, but shuts down unused threads early.
   The H2MaxWorkerIdleSeconds is also reduced to 1, so that any workers
   for ongoing tasks will close down fast.
  • Loading branch information
Stefan Eissing committed Jul 19, 2021
1 parent 3ad72b8 commit 54dd4fe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v1.15.23
--------------------------------------------------------------------------------
* H2MinWorker is reduced automatically to 1 during graceful shutdown
of a child process (e.g. server reload). This lets all ongoing requests
continue, but shuts down unused threads early.
The H2MaxWorkerIdleSeconds is also reduced to 1, so that any workers
for ongoing tasks will close down fast.

v1.15.22
--------------------------------------------------------------------------------
* Added a timeout to h2 worker cleanup to exit latest after 5 seconds of
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#

AC_PREREQ([2.69])
AC_INIT([mod_http2], [1.15.22], [[email protected]])
AC_INIT([mod_http2], [1.15.23], [[email protected]])

LT_PREREQ([2.2.6])
LT_INIT()
Expand Down
4 changes: 2 additions & 2 deletions mod_http2/h2_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
* @macro
* Version number of the http2 module as c string
*/
#define MOD_HTTP2_VERSION "1.15.22-git"
#define MOD_HTTP2_VERSION "1.15.23-git"

/**
* @macro
* Numerical representation of the version number of the http2 module
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define MOD_HTTP2_VERSION_NUM 0x010f16
#define MOD_HTTP2_VERSION_NUM 0x010f17


#endif /* mod_h2_h2_version_h */
2 changes: 2 additions & 0 deletions mod_http2/h2_workers.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ apr_status_t h2_workers_unregister(h2_workers *workers, struct h2_mplx *m)
void h2_workers_graceful_shutdown(h2_workers *workers)
{
workers->shutdown = 1;
workers->min_workers = 1;
workers->max_idle_duration = apr_time_from_sec(1);
h2_fifo_term(workers->mplxs);
wake_non_essential_workers(workers);
}
4 changes: 2 additions & 2 deletions mod_http2/h2_workers.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ struct h2_workers {
apr_pool_t *pool;

int next_worker_id;
apr_uint32_t min_workers;
apr_uint32_t max_workers;
apr_interval_time_t max_idle_duration;
volatile apr_uint32_t min_workers; /* is changed during graceful shutdown */
volatile apr_interval_time_t max_idle_duration; /* is changed during graceful shutdown */

volatile int aborted;
volatile int shutdown;
Expand Down

0 comments on commit 54dd4fe

Please sign in to comment.