-
Notifications
You must be signed in to change notification settings - Fork 849
Description
There is a problem in closing the Http Tunnel if there is lock contention.
Without lock contention: HttpSM.cc:2589 default_handler is tunnel_handler and it is given HTTP_TUNNEL_EVENT_CLOSE, kill_this() (HttpSM.cc:2602) eventually calls state_api_callout(0, nullptr). Plugin lock is acquired in HttpSM.cc:1443 does some stuff and exits function. Continues correctly.
With lock contention: HttpSM.cc:2589 default_handler is tunnel_handler and it is given HTTP_TUNNEL_EVENT_CLOSE, kill_this() (HttpSM.cc:2602) eventually calls state_api_callout(0, nullptr). In line HttpSM:1441, the default handler is set to state_api_callout. It is rescheduled in HttpSM.cc:1443. Now, when it renters the SM, the event code HTTP_EVENT_TUNNEL_CLOSE is given to state_api_callout rather than state_api_callout(0, nullptr). This causes it to enter a different switch case and eventually messes up.
Test to produce bug: #3047 (openclose_h2.test.py)
Potential Fix (kinda hacky): xf6wang@58fa79e