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:
Max Romanov
2017-07-07 16:01:34 +03:00
parent 61008a7c0b
commit 74cda90e31
11 changed files with 113 additions and 22 deletions

View File

@@ -146,7 +146,7 @@ nxt_go_port_on_read(void *buf, size_t buf_size, void *oob, size_t oob_size)
nxt_go_debug("using data in shared memory");
}
if (port_msg->type > NXT_PORT_MSG_MAX) {
if (port_msg->type >= NXT_PORT_MSG_MAX) {
nxt_go_warn("unknown message type (%d)", (int)port_msg->type);
goto fail;
}
@@ -181,6 +181,13 @@ nxt_go_port_on_read(void *buf, size_t buf_size, void *oob, size_t oob_size)
return nxt_go_data_handler(port_msg, buf_size);
case NXT_PORT_MSG_REMOVE_PID:
nxt_go_debug("remove pid");
/* TODO remove all ports for this pid in Go */
/* TODO remove incoming & outgoing mmaps for this pid */
break;
default:
goto fail;
}