Process stop notification from master to all other processes.
New port message type introduced NXT_PORT_MSG_REMOVE_PID. Default handler removes process description from nxt_runtime_t with all ports, incoming and outgoing mmaps etc.
This commit is contained in:
@@ -52,7 +52,7 @@ nxt_port_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
{
|
||||
nxt_port_handler_t *handlers;
|
||||
|
||||
if (nxt_fast_path(msg->port_msg.type <= NXT_PORT_MSG_MAX)) {
|
||||
if (nxt_fast_path(msg->port_msg.type < NXT_PORT_MSG_MAX)) {
|
||||
|
||||
nxt_debug(task, "port %d: message type:%uD",
|
||||
msg->port->socket.fd, msg->port_msg.type);
|
||||
@@ -291,6 +291,26 @@ nxt_port_data_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nxt_port_remove_pid_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
{
|
||||
nxt_pid_t pid;
|
||||
nxt_runtime_t *rt;
|
||||
nxt_process_t *process;
|
||||
|
||||
nxt_debug(task, "port remove pid handler");
|
||||
|
||||
rt = task->thread->runtime;
|
||||
pid = msg->port_msg.stream;
|
||||
|
||||
process = nxt_runtime_process_find(rt, pid);
|
||||
|
||||
if (process) {
|
||||
nxt_runtime_process_remove(rt, process);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nxt_port_empty_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user