DEV: sock: Add a debug counter to track strange flag on fd during connect()
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Dec 2024 07:43:06 +0000 (08:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Jan 2025 14:56:04 +0000 (15:56 +0100)
This counter was removed when the commit 56cd20cb53 ("BUG/MEDIUM: sock:
Remove FD_POLL_HUP during connect() if FD_POLL_ERR is not set") was
backported because the debug counters were not backported yet to the
3.0. Now de debug counters are available in 3.0, this counter can also be
added.

This commit is 3.0-specific. There is no upstream ID.

src/sock.c

index ce0cb2f..7078fc0 100644 (file)
@@ -904,6 +904,7 @@ int sock_conn_check(struct connection *conn)
                 *   - https://www.spinics.net/lists/netdev/msg876470.html
                 */
                if (unlikely((fdtab[fd].state & (FD_POLL_HUP|FD_POLL_ERR)) == FD_POLL_HUP)) {
+                       COUNT_IF(1, "Removing FD_POLL_HUP if no FD_POLL_ERR to let connect() decide");
                        fdtab[fd].state &= ~FD_POLL_HUP;
                }