From 74cda90e31f97ba0ebd6483f2b073c1240b93a58 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Fri, 7 Jul 2017 16:01:34 +0300 Subject: 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. --- src/nginext/nxt_go_port.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/nginext') diff --git a/src/nginext/nxt_go_port.c b/src/nginext/nxt_go_port.c index 47e46f02..58ba90ea 100644 --- a/src/nginext/nxt_go_port.c +++ b/src/nginext/nxt_go_port.c @@ -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; } -- cgit