During a RESUME operation, if a 'MySQL_Thread' is bootstrapping listeners (in MySQL_Thread::run_BootstrapListener) and detect that MySQL_Threads_Handler::bootstrapping_listeners is 'false', the thread prematurely shuts down its own bootstrapping flag from 'mypolls' (ProxySQL_Poll::bootstrapping_listeners). Since this thread wont ever bootstrap its corresponding listening sockets, the other working threads will be stalled waiting on it, eventually triggering the watchdog and crashing the instance.
Solution
Simplified the logic using a unique flag for bootstrapping (MySQL_Threads_Handler::bootstrapping_listeners) and introduced a sensible delay to reduce the potential overhead of the worker threads busy-waiting for its time to start their listening sockets, as well as the counterpart overhead on the Admin thread while performing the PAUSE operation.
Issue Description
During a
RESUME
operation, if a 'MySQL_Thread' is bootstrapping listeners (inMySQL_Thread::run_BootstrapListener
) and detect thatMySQL_Threads_Handler::bootstrapping_listeners
is 'false', the thread prematurely shuts down its own bootstrapping flag from 'mypolls' (ProxySQL_Poll::bootstrapping_listeners
). Since this thread wont ever bootstrap its corresponding listening sockets, the other working threads will be stalled waiting on it, eventually triggering the watchdog and crashing the instance.Solution
Simplified the logic using a unique flag for bootstrapping (
MySQL_Threads_Handler::bootstrapping_listeners
) and introduced a sensible delay to reduce the potential overhead of the worker threads busy-waiting for its time to start their listening sockets, as well as the counterpart overhead on theAdmin
thread while performing thePAUSE
operation.