summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_main_process.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-10-19 17:37:19 +0300
committerMax Romanov <max.romanov@nginx.com>2017-10-19 17:37:19 +0300
commitb3aab8c66fa7269147a6696c98a52971020be6e8 (patch)
tree30fb2198ab3293f7248b6ae65692f792a590501e /src/nxt_main_process.c
parent6031c63225838d6bc266c4f015d9a1085f600324 (diff)
downloadunit-b3aab8c66fa7269147a6696c98a52971020be6e8.tar.gz
unit-b3aab8c66fa7269147a6696c98a52971020be6e8.tar.bz2
Filtering process to keep connection.
- Main process should be connected to all other processes. - Controller should be connected to Router. - Router should be connected to Controller and all Workers. - Workers should be connected to Router worker thread ports only. This filtering helps to avoid unnecessary communication and various errors during massive application workers stop / restart.
Diffstat (limited to 'src/nxt_main_process.c')
-rw-r--r--src/nxt_main_process.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nxt_main_process.c b/src/nxt_main_process.c
index 819b797b..d6743b68 100644
--- a/src/nxt_main_process.c
+++ b/src/nxt_main_process.c
@@ -764,6 +764,7 @@ nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid)
nxt_port_t *port;
nxt_runtime_t *rt;
nxt_process_t *process;
+ nxt_process_type_t ptype;
nxt_process_init_t *init;
rt = task->thread->runtime;
@@ -773,6 +774,8 @@ nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid)
if (process) {
init = process->init;
+ ptype = nxt_process_type(process);
+
nxt_process_close_ports(task, process);
if (!nxt_exiting) {
@@ -787,6 +790,10 @@ nxt_main_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid)
port = nxt_process_port_first(process);
+ if (nxt_proc_remove_notify_martix[ptype][port->type] == 0) {
+ continue;
+ }
+
buf = nxt_buf_mem_ts_alloc(task, task->thread->engine->mem_pool,
sizeof(pid));
buf->mem.free = nxt_cpymem(buf->mem.free, &pid, sizeof(pid));