vcl: fix some risk after fork() 31/33231/5
authorliuyacan <liuyacan@corp.netease.com>
Thu, 22 Jul 2021 07:52:01 +0000 (15:52 +0800)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 27 Jul 2021 00:58:59 +0000 (00:58 +0000)
commit603e1a415e4974e59ee952a9c7fb0db4e99fe1a3
tree43428f0edcb4641dd75dfb3b293a8f1fe497f4b5
parent6fc07b43267d1433ba67c5799341ee54eb4bd8fb
vcl: fix some risk after fork()

1.Not only the session in state VCL_STATE_LISTEN_NO_MQ
has no queue. Session in CLOSED also didn't.
2.Refresh vls->wrk_index in child process, or this value will
become invalid if parent exit.
3.Set vlsh->vls_wrk_index once vls_worker_alloc() is called, then
vls_get_worker_index() can be simplified.

Type: fix

Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: If4f5e134915eafd74ce38f585d65ce8836b2e553
src/vcl/vcl_locked.c