diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-07-18 00:21:14 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-07-18 00:21:14 +0300 |
commit | eb675f2d78178b2cdd54d934022f9b739bfa8952 (patch) | |
tree | 0b072c752fff35cd5c4498cded7016a5738caa58 /src/nxt_runtime.c | |
parent | 47b359388cdf6348238e7fc05770426448049189 (diff) | |
download | unit-eb675f2d78178b2cdd54d934022f9b739bfa8952.tar.gz unit-eb675f2d78178b2cdd54d934022f9b739bfa8952.tar.bz2 |
Port allocation and destroy changed. Worker process stop introduced.
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r-- | src/nxt_runtime.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index 6ddf27c1..8b216337 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -1542,7 +1542,6 @@ nxt_runtime_process_find(nxt_runtime_t *rt, nxt_pid_t pid) lhq.proto = &lvlhsh_processes_proto; if (nxt_lvlhsh_find(&rt->processes, &lhq) == NXT_OK) { - nxt_thread_log_debug("process %PI found", pid); return lhq.value; } @@ -1662,9 +1661,13 @@ nxt_runtime_process_remove(nxt_runtime_t *rt, nxt_process_t *process) nxt_runtime_port_remove(rt, port); + nxt_port_release(port); + } nxt_process_port_loop; - nxt_runtime_process_destroy(rt, process); + if (nxt_queue_is_empty(&process->ports)) { + nxt_runtime_process_destroy(rt, process); + } break; @@ -1709,24 +1712,6 @@ nxt_runtime_port_remove(nxt_runtime_t *rt, nxt_port_t *port) if (rt->port_by_type[port->type] == port) { rt->port_by_type[port->type] = NULL; } - - if (port->pair[0] != -1) { - nxt_fd_close(port->pair[0]); - } - - if (port->pair[1] != -1) { - nxt_fd_close(port->pair[1]); - } - - if (port->type == NXT_PROCESS_WORKER) { - nxt_router_app_remove_port(port); - } - - if (port->mem_pool) { - nxt_mp_destroy(port->mem_pool); - } - - nxt_mp_free(rt->mem_pool, port); } |