]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: applet: use a separate run queue to maintain list integrity
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 15:56:16 +0000 (17:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 16:07:16 +0000 (18:07 +0200)
commit9994238adc2c1f1003f72eefe08e610c1baf1bf3
treea31dc7f7be69c7f6b7b1ca2477c2359332483da6
parent64bca9d36ad8cb109cefa7cba3fd9ebba2eca8e0
BUG/MAJOR: applet: use a separate run queue to maintain list integrity

If an applet wakes up and causes the next one to sleep, the active list
is corrupted and cannot be scanned anymore, as the process then loops
over the next element.

In order to avoid this problem, we move the active applet list to a run
queue and reinit the active list. Only the first element of this queue
is checked, and if the element is not removed, it is removed and requeued
into the active list.

Since we're using a distinct list, if an applet wants to requeue another
applet into the active list, it properly gets added to the active list
and not to the run queue.

This stops the infinite loop issue that could be caused with Lua applets,
and in any future configuration where two applets could be attached
together.
src/applet.c