Mercurial > hg > nginx
changeset 4953:5e9d5786ec06 stable-1.2
Merge of r4918: cache manager startup with many listen sockets.
Fixed failure to start cache manager and cache loader processes
if there were more than 512 listening sockets in configuration.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 10 Dec 2012 17:46:51 +0000 |
parents | 3795aeb360fb |
children | 7c034ee61244 |
files | src/core/ngx_connection.c src/os/unix/ngx_process_cycle.c |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_connection.c Mon Dec 10 16:35:32 2012 +0000 +++ b/src/core/ngx_connection.c Mon Dec 10 17:46:51 2012 +0000 @@ -749,6 +749,8 @@ ls[i].fd = (ngx_socket_t) -1; } + + cycle->listening.nelts = 0; }
--- a/src/os/unix/ngx_process_cycle.c Mon Dec 10 16:35:32 2012 +0000 +++ b/src/os/unix/ngx_process_cycle.c Mon Dec 10 17:46:51 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;