comparison src/os/win32/ngx_process.c @ 4757:e00b71ece8b3

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
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 23 Jul 2012 16:37:24 +0000
parents d620f497c50f
children 2b7dacb381ed
comparison
equal deleted inserted replaced
4756:daa60662b7b5 4757:e00b71ece8b3
194 194
195 TerminateProcess(ngx_processes[s].handle, 2); 195 TerminateProcess(ngx_processes[s].handle, 2);
196 196
197 if (ngx_processes[s].handle) { 197 if (ngx_processes[s].handle) {
198 ngx_close_handle(ngx_processes[s].handle); 198 ngx_close_handle(ngx_processes[s].handle);
199 ngx_processes[s].handle = NULL;
199 } 200 }
200 201
201 return NGX_INVALID_PID; 202 return NGX_INVALID_PID;
202 } 203 }
203 204