diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-10-19 17:37:19 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-10-19 17:37:19 +0300 |
commit | b3aab8c66fa7269147a6696c98a52971020be6e8 (patch) | |
tree | 30fb2198ab3293f7248b6ae65692f792a590501e /src/nxt_port.c | |
parent | 6031c63225838d6bc266c4f015d9a1085f600324 (diff) | |
download | unit-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 '')
-rw-r--r-- | src/nxt_port.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nxt_port.c b/src/nxt_port.c index 52144759..c63ea01b 100644 --- a/src/nxt_port.c +++ b/src/nxt_port.c @@ -177,7 +177,7 @@ nxt_port_quit_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg) } -void +nxt_inline void nxt_port_send_new_port(nxt_task_t *task, nxt_runtime_t *rt, nxt_port_t *new_port, uint32_t stream) { @@ -195,10 +195,7 @@ nxt_port_send_new_port(nxt_task_t *task, nxt_runtime_t *rt, port = nxt_process_port_first(process); - if (port->type == NXT_PROCESS_MAIN - || port->type == NXT_PROCESS_CONTROLLER - || port->type == NXT_PROCESS_ROUTER) - { + if (nxt_proc_conn_martix[port->type][new_port->type]) { (void) nxt_port_send_port(task, port, new_port, stream); } |