BUG/MEDIUM: lua/socket: Sheduling error on write: may dead-lock
authorThierry FOURNIER <thierry.fournier@ozon.io>
Sat, 26 May 2018 23:27:40 +0000 (01:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 May 2018 08:58:41 +0000 (10:58 +0200)
commit101b97619a5d0b45484a37395f1b22d064c806cb
treedac3a03d6ab049e2cb7437383e74b000b3167730
parentba42fcd064c3f371610126dee6f25c2d7f1e4040
BUG/MEDIUM: lua/socket: Sheduling error on write: may dead-lock

When we write data, we risk to encounter a dead-loack. The
function "stream_int_notify()" cannot be called the the
cosocket because the caller acquire a lock and when the socket
is closed, the cleanup function try to acquire the same lock.,
so a dead-lock raises.

In other way, the function stream_int_update_applet() can't
be called because it schedumes the applet only if some activity
in the buffers were detected. It is not always the case. We
replace this function by appctx_wakeup() which wake up the
applet inconditionnaly.

The last part of the fix is setting right signals. the applet
call the stream_int_update() function if the output buffer si
not empty, and ask for put data if some rite signals are
registered.

This patch must be backported in 1.6, 1.7 and 1.8. Note that it requires
patch "MINOR: task/notification: Is notifications registered" to be
applied.
src/hlua.c