]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: queue: Replace if() + abort() with BUG_ON()
authorTim Duesterhus <tim@bastelstu.be>
Mon, 28 Feb 2022 18:16:31 +0000 (19:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 1 Mar 2022 09:14:56 +0000 (10:14 +0100)
see 5cd4bbd7a ("BUG/MAJOR: threads/queue: Fix thread-safety issues on the queues management")

src/queue.c

index b1be766b9e45795965224733194e6c3cdac18f5f..002b94b85df1bebbf332da10470bb68579d66ffe 100644 (file)
@@ -567,14 +567,13 @@ int pendconn_dequeue(struct stream *strm)
        struct pendconn *p;
        int is_unlinked;
 
-       if (unlikely(!strm->pend_pos)) {
-               /* unexpected case because it is called by the stream itself and
-                * only the stream can release a pendconn. So it is only
-                * possible if a pendconn is released by someone else or if the
-                * stream is supposed to be queued but without its associated
-                * pendconn. In both cases it is a bug! */
-               abort();
-       }
+       /* unexpected case because it is called by the stream itself and
+        * only the stream can release a pendconn. So it is only
+        * possible if a pendconn is released by someone else or if the
+        * stream is supposed to be queued but without its associated
+        * pendconn. In both cases it is a bug! */
+       BUG_ON(!strm->pend_pos);
+
        p = strm->pend_pos;
 
        /* note below : we need to grab the queue's lock to check for emptiness