# HG changeset patch # User Igor Sysoev # Date 1353418675 0 # Node ID 484aec758d2c34fce25c55f7a7b1b991fd5a0f5e # Parent 79c8e87b1fcbf639ff935eab8f9c5f1a5c32531f Fixed failure to start cache manager and cache loader processes if there were more than 512 listening sockets in configuration. diff -r 79c8e87b1fcb -r 484aec758d2c src/core/ngx_connection.c --- a/src/core/ngx_connection.c Sat Nov 17 00:36:44 2012 +0000 +++ b/src/core/ngx_connection.c Tue Nov 20 13:37:55 2012 +0000 @@ -749,6 +749,8 @@ ls[i].fd = (ngx_socket_t) -1; } + + cycle->listening.nelts = 0; } diff -r 79c8e87b1fcb -r 484aec758d2c src/os/unix/ngx_process_cycle.c --- a/src/os/unix/ngx_process_cycle.c Sat Nov 17 00:36:44 2012 +0000 +++ b/src/os/unix/ngx_process_cycle.c Tue Nov 20 13:37:55 2012 +0000 @@ -1296,13 +1296,18 @@ void *ident[4]; ngx_event_t ev; - cycle->connection_n = 512; - + /* + * Set correct process type since closing listening Unix domain socket + * in a master process also removes the Unix domain socket file. + */ ngx_process = NGX_PROCESS_HELPER; - ngx_worker_process_init(cycle, -1); + ngx_close_listening_sockets(cycle); - ngx_close_listening_sockets(cycle); + /* Set a moderate number of connections for a helper process. */ + cycle->connection_n = 512; + + ngx_worker_process_init(cycle, -1); ngx_memzero(&ev, sizeof(ngx_event_t)); ev.handler = ctx->handler;