From 2c636a03f35c1807fa0744b53d19f364b131dc1d Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 24 Nov 2021 13:11:47 +0300 Subject: Sending shared port to application prototype. Application process started with shared port (and queue) already configured. But still waits for PORT_ACK message from router to start request processing (so-called "ready state"). Waiting for router confirmation is necessary. Otherwise, the application may produce response and send it to router before the router have the information about the application process. This is a subject of further optimizations. --- src/nxt_application.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nxt_application.c') diff --git a/src/nxt_application.c b/src/nxt_application.c index 589821fb..d1ff9ee7 100644 --- a/src/nxt_application.c +++ b/src/nxt_application.c @@ -1052,6 +1052,9 @@ nxt_unit_default_init(nxt_task_t *task, nxt_unit_init_t *init, init->read_port.in_fd = my_port->pair[0]; init->read_port.out_fd = my_port->pair[1]; + init->shared_port_fd = conf->shared_port_fd; + init->shared_queue_fd = conf->shared_queue_fd; + init->log_fd = 2; init->shm_limit = conf->shm_limit; -- cgit From 64db3ef1bbf32457aefb002b9fecabb6c07923f9 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 1 Dec 2021 18:05:50 +0300 Subject: Fixing prototype process crash. A prototype stores linked application processes structures. When an application process terminates, it's removed from the list. To avoid double removal, the pointer to the next element should be set to NULL. The issue was introduced in c8790d2a89bb. --- src/nxt_application.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nxt_application.c') diff --git a/src/nxt_application.c b/src/nxt_application.c index d1ff9ee7..594574b1 100644 --- a/src/nxt_application.c +++ b/src/nxt_application.c @@ -1150,6 +1150,8 @@ nxt_proto_process_remove(nxt_task_t *task, nxt_pid_t pid) process = lhq.value; nxt_queue_remove(&process->link); + process->link.next = NULL; + break; default: -- cgit