From: Olivier Houchard Date: Fri, 31 Jan 2020 16:22:08 +0000 (+0100) Subject: BUG/MEDIUM: connections: Don't forget to unlock when killing a connection. X-Git-Tag: v2.2-dev2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=849d4f047f768184f30b989d06502c601f355b9f;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: connections: Don't forget to unlock when killing a connection. Commit 140237471e408736bb7162e68c572c710a66a526 made sure we hold the toremove_lock for the corresponding thread before removing a connection from its idle_orphan_conns list, however it failed to unlock it if we found a connection, leading to a deadlock, so add the missing deadlock. This should be backported to 2.1 and 2.0. --- diff --git a/src/backend.c b/src/backend.c index 45fe5366a2..39791f6f64 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1255,6 +1255,7 @@ int connect_server(struct stream *s) MT_LIST_ADDQ(&toremove_connections[i], (struct mt_list *)&tokill_conn->list); task_wakeup(idle_conn_cleanup[i], TASK_WOKEN_OTHER); + HA_SPIN_UNLOCK(OTHER_LOCK, &toremove_lock[tid]); break; } HA_SPIN_UNLOCK(OTHER_LOCK, &toremove_lock[tid]);