session: no reply on app del worker with sapi 17/40017/2
authorFlorin Coras <fcoras@cisco.com>
Tue, 28 Nov 2023 23:28:16 +0000 (15:28 -0800)
committerDave Wallace <dwallacelf@gmail.com>
Wed, 29 Nov 2023 17:01:08 +0000 (17:01 +0000)
With socket api, applications should not expect reply after worker del
msg. VCL in particular closes the socket after it enqueues the message.

Found by ASAN.

Type: fix

Signed-off-by: Dmitry Valter <d-valter@yandex-team.com>
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1be02a0cde6b96a96edb709f3fe30bbc01ff2d24

src/vnet/session/session_api.c

index ff49d2a..06edb82 100644 (file)
@@ -1463,6 +1463,10 @@ sapi_add_del_worker_handler (app_namespace_t * app_ns,
 
 done:
 
+  /* With app sock api socket expected to be closed, no reply */
+  if (!mp->is_add && appns_sapi_enabled ())
+    return;
+
   msg.type = APP_SAPI_MSG_TYPE_ADD_DEL_WORKER_REPLY;
   rmp = &msg.worker_add_del_reply;
   rmp->retval = rv;