From: Igor Sysoev Date: Tue, 20 Nov 2012 13:37:55 +0000 (+0000) Subject: Fixed failure to start cache manager and cache loader processes X-Git-Tag: release-1.3.9~23 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=da130acfbe130ce655314ec128bcc1e5f0e334c6;p=nginx.git Fixed failure to start cache manager and cache loader processes if there were more than 512 listening sockets in configuration. --- diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index 660e0af4a..c818114df 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -749,6 +749,8 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle) ls[i].fd = (ngx_socket_t) -1; } + + cycle->listening.nelts = 0; } diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index acafb7f6f..c9b0266ed 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -1296,14 +1296,19 @@ ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data) 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); + /* 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; ev.data = ident;