mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MAJOR: thread/peers: fix deadlock on peers sync.
Table lock was not released on an error path (if there is no enough room to write table switch message). [wt: needs to be backported to 1.8]
This commit is contained in:
parent
0fed0b0a38
commit
088c9b73ca
@ -1474,6 +1474,7 @@ incomplete:
|
|||||||
|
|
||||||
msglen = peer_prepare_switchmsg(st, trash.str, trash.size);
|
msglen = peer_prepare_switchmsg(st, trash.str, trash.size);
|
||||||
if (!msglen) {
|
if (!msglen) {
|
||||||
|
HA_SPIN_UNLOCK(STK_TABLE_LOCK, &st->table->lock);
|
||||||
/* internal error: message does not fit in trash */
|
/* internal error: message does not fit in trash */
|
||||||
appctx->st0 = PEER_SESS_ST_END;
|
appctx->st0 = PEER_SESS_ST_END;
|
||||||
goto switchstate;
|
goto switchstate;
|
||||||
@ -1482,6 +1483,7 @@ incomplete:
|
|||||||
/* message to buffer */
|
/* message to buffer */
|
||||||
repl = ci_putblk(si_ic(si), trash.str, msglen);
|
repl = ci_putblk(si_ic(si), trash.str, msglen);
|
||||||
if (repl <= 0) {
|
if (repl <= 0) {
|
||||||
|
HA_SPIN_UNLOCK(STK_TABLE_LOCK, &st->table->lock);
|
||||||
/* no more write possible */
|
/* no more write possible */
|
||||||
if (repl == -1) {
|
if (repl == -1) {
|
||||||
goto full;
|
goto full;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user