From: Maxim Dounin Date: Mon, 23 Jul 2012 16:37:24 +0000 (+0000) Subject: Win32: fixed cpu hog after process startup failure. X-Git-Tag: release-1.3.4~15 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=9d5f5a0c76dc0aba74777b8afad95e2d6ed12354;p=nginx.git Win32: fixed cpu hog after process startup failure. If ngx_spawn_process() failed while starting a process, the process handle was closed but left non-NULL in the ngx_processes[] array. The handle later was used in WaitForMultipleObjects() (if there were multiple worker processes configured and at least one worker process was started successfully), resulting in infinite loop. Reported by Ricardo V G: http://mailman.nginx.org/pipermail/nginx-devel/2012-July/002494.html --- diff --git a/src/os/win32/ngx_process.c b/src/os/win32/ngx_process.c index 87e8f9a2a..67c6b121a 100644 --- a/src/os/win32/ngx_process.c +++ b/src/os/win32/ngx_process.c @@ -196,6 +196,7 @@ failed: if (ngx_processes[s].handle) { ngx_close_handle(ngx_processes[s].handle); + ngx_processes[s].handle = NULL; } return NGX_INVALID_PID;