]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: threads/cli: fix "show sess" locking on release
authorWilly Tarreau <w@1wt.eu>
Fri, 10 Nov 2017 15:24:41 +0000 (16:24 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Nov 2017 15:24:41 +0000 (16:24 +0100)
The recent thread updates on the CLI broke "show sess" by unlocking
the stream twice instead of lock+unlock. No backport is needed.

src/stream.c

index 8f81622dd46a197efd053f054c1195c237e1eaf4..48c4ba53d879f3a2a83f144f5ef3be46c0dcdac4 100644 (file)
@@ -3252,7 +3252,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
 static void cli_release_show_sess(struct appctx *appctx)
 {
        if (appctx->st2 == STAT_ST_LIST) {
-               HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);
+               HA_SPIN_LOCK(STRMS_LOCK, &streams_lock);
                if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users))
                        LIST_DEL(&appctx->ctx.sess.bref.users);
                HA_SPIN_UNLOCK(STRMS_LOCK, &streams_lock);