From 7ef30c4dfea6f75766a6b2c468950fc5357424b2 Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Thu, 9 Mar 2006 11:21:59 +0000 Subject: [PATCH] don't forget the waitpid() for locally spawned processes (patch by Cameron Ring) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@1038 152afb58-edef-0310-8abb-c4023f1b3aa9 --- src/mod_fastcgi.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index 22f003e9..e64351ad 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -2725,7 +2725,14 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { "socket:", hctx->proc->connection_name); } - hctx->proc->disabled_until = srv->cur_ts + 10; + hctx->proc->disabled_until = srv->cur_ts + 5; + + if (hctx->proc->is_local) { + hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID; + } else { + hctx->proc->state = PROC_STATE_DIED; + } + hctx->proc->state = PROC_STATE_DIED; fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc); @@ -2831,12 +2838,21 @@ 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 10 seconds + * for check if the host is back in 5 seconds * */ - hctx->proc->disabled_until = srv->cur_ts + 10; - hctx->proc->state = PROC_STATE_DIED; - + hctx->proc->disabled_until = srv->cur_ts + 5; + 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 disable it for a 5 seconds and send the request to another backend instead:", + "reconnects:", hctx->reconnects, + "load:", host->load); + fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc); buffer_append_string(p->statuskey, ".died");