vcl: Don't use app_socket_api to notify VPP in parent when child exited 44/32944/2
authorwanghanlin <wanghanlin@corp.netease.com>
Tue, 29 Jun 2021 08:01:55 +0000 (16:01 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 29 Jun 2021 14:30:01 +0000 (14:30 +0000)
Type: fix

Signed-off-by: wanghanlin <wanghanlin@corp.netease.com>
Change-Id: Icd2fc3cc2d0a0a6060abfb262044cf9e09ab4ba2

src/vcl/vcl_locked.c

index 30d5f5f..e8f56c6 100644 (file)
@@ -1530,7 +1530,11 @@ vls_cleanup_vcl_worker (vcl_worker_t * wrk)
   /* Unshare sessions and also cleanup worker since child may have
    * called _exit () and therefore vcl may not catch the event */
   vls_unshare_vcl_worker_sessions (wrk);
-  vcl_worker_cleanup (wrk, 1 /* notify vpp */ );
+
+  /* Since child may have exited and thereforce fd of vpp_app_socket_api
+   * may have been closed, so DONOT notify VPP.
+   */
+  vcl_worker_cleanup (wrk, vcm->cfg.vpp_app_socket_api ? 0 : 1);
 
   vls_worker_free (vls_wrk);
 }