allow mpm to be note connections that are not TCP based. - #699
allow mpm to be note connections that are not TCP based.#699machine-moon wants to merge 4 commits into
Conversation
|
Looks OK for me, could we move forward, any comments? |
|
fetched latest apache/trunk and cherry-picked my commits on top, the conflict was in the CHANGES file. |
|
needs an MMN bump? |
| ap_run_child_stopping(pchild, !retained->mpm->is_ungraceful); | ||
| if (!retained->mpm->is_ungraceful) { | ||
| while (apr_atomic_read32(&connection_count) > 0) { | ||
| apr_sleep(apr_time_from_msec(100)); |
There was a problem hiding this comment.
should we re-purpose Timeout or GracefulShutdownTimeout here, minimally for logging?
There was a problem hiding this comment.
Something like the following no?:
if (terminate_mode == ST_GRACEFUL) {
apr_time_t start_time = apr_time_now();
/* ap_graceful_shutdown_timeout is in seconds; 0 means wait indefinitely */
apr_time_t timeout_interval = apr_time_from_sec(ap_graceful_shutdown_timeout);
while (apr_atomic_read32(&connection_count) > 0) {
/* Check if we exceeded GracefulShutdownTimeout (if timeout > 0) */
if (ap_graceful_shutdown_timeout > 0 &&
(apr_time_now() - start_time) >= timeout_interval) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ap_server_conf,
APLOGNO(...) "Graceful shutdown timeout (%d sec) expired, "
"forcing exit with %u active connections",
ap_graceful_shutdown_timeout,
apr_atomic_read32(&connection_count));
break;
}
/* Check if server state changed to forced terminate mid-graceful */
if (ap_mpm_state == AP_MPMQ_STOPPING) {
break;
}
apr_sleep(apr_time_from_msec(100));
}
}
There was a problem hiding this comment.
Never realized the default was 0, it would mean still waiting forever w/ on message if the added connections aren't removed in a timely way.
Some other ideas (no strong feelings):
- Max of Timeout or ap_graceful_shutdown_timeout here at least for the logging aspect?
- Maybe in the header we could reinforce what we expect of modules that add connections this way, i.e. detecting graceful termination and putting some bound on how long they can linger?
|
I am afraid it does require a MMN bump |
2 commits:
mpm prefork and worker: c80fb0e
mpm_event: 7cbb186