# HG changeset patch # User Maxim Dounin # Date 1343061444 0 # Node ID e00b71ece8b3e44efbc9d542192d0114dce62f8f # Parent daa60662b7b57ee285afc705d175cb31db258418 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 --- 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;