diff --git a/NEWS b/NEWS index 665abc90..946625c2 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,7 @@ NEWS * Fix issues found with clang analyzer * Try to fix server.tag issue with localized svnversion * Fix handling network-write return values (#2024) + * Use disable-time in fastcgi for all disables after errors, default is 1sec (fixes #2040) - 1.4.23 - 2009-06-19 * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions) diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index 23abad33..c7b2e538 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -1286,7 +1286,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) { host->max_load_per_proc = 1; host->idle_timeout = 60; host->mode = FCGI_RESPONDER; - host->disable_time = 60; + host->disable_time = 1; host->break_scriptfilename_for_php = 0; host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */ host->kill_signal = SIGTERM; @@ -2804,7 +2804,7 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { host->port, host->unixsocket->used); - hctx->proc->disabled_until = srv->cur_ts + 10; + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time; hctx->proc->state = PROC_STATE_DIED; return HANDLER_ERROR; @@ -2820,7 +2820,7 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { log_error_write(srv, __FILE__, __LINE__, "ss", "getsockopt failed:", strerror(errno)); - hctx->proc->disabled_until = srv->cur_ts + 10; + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time; hctx->proc->state = PROC_STATE_DIED; return HANDLER_ERROR; @@ -2834,7 +2834,7 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { "socket:", hctx->proc->connection_name); } - hctx->proc->disabled_until = srv->cur_ts + 5; + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time; if (hctx->proc->is_local) { hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID; @@ -2927,13 +2927,13 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { /* cool down the backend, it is overloaded * -> EAGAIN */ - log_error_write(srv, __FILE__, __LINE__, "ssdsd", - "backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead:", + log_error_write(srv, __FILE__, __LINE__, "sdssdsd", + "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:", "reconnects:", hctx->reconnects, "load:", host->load); - hctx->proc->disabled_until = srv->cur_ts + 2; + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time; hctx->proc->state = PROC_STATE_OVERLOADED; fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc); @@ -2947,18 +2947,18 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { * - ECONNREFUSED for tcp-ip sockets * - ENOENT for unix-domain-sockets * - * for check if the host is back in 5 seconds + * for check if the host is back in hctx->host->disable_time seconds * */ - hctx->proc->disabled_until = srv->cur_ts + 5; + hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time; if (hctx->proc->is_local) { hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID; } else { hctx->proc->state = PROC_STATE_DIED; } - log_error_write(srv, __FILE__, __LINE__, "ssdsd", - "backend died; we'll disable it for 5 seconds and send the request to another backend instead:", + log_error_write(srv, __FILE__, __LINE__, "sdssdsd", + "backend died; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:", "reconnects:", hctx->reconnects, "load:", host->load);