]> git.kaiwu.me - haproxy.git/commitdiff
DEBUG: DO NOT MERGE! 20260319-haload
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 16 Apr 2026 06:14:13 +0000 (08:14 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Tue, 5 May 2026 17:51:33 +0000 (19:51 +0200)
src/backend.c

index 19d25aea19ae086815ffb8a630e5f4486d4c1c54..39e01dbafc7acfd956062103ecdcb95bc911f7d9 100644 (file)
 
 #define TRACE_SOURCE &trace_strm
 
+#if 0
+#define DDPRINTF(x...) fprintf(x)
+#else
+#define DDPRINTF(x...) do {} while(0)
+#endif
+
 /* helper function to invoke the correct hash method */
 unsigned int gen_hash(const struct proxy* px, const char* key, unsigned long len)
 {
@@ -1689,6 +1695,8 @@ int be_reuse_connection(int64_t hash, struct session *sess,
 
        /* first, search for a matching connection in the session's idle conns */
        srv_conn = session_get_conn(sess, target, hash);
+       if (!srv_conn)
+               DDPRINTF(stderr, "/");
        if (srv_conn) {
                //DBG_TRACE_STATE("reuse connection from session", STRM_EV_STRM_PROC|STRM_EV_CS_ST, strm);
        }
@@ -1760,6 +1768,7 @@ int be_reuse_connection(int64_t hash, struct session *sess,
                                /* no more streams available, remove it from the list */
                                HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
                                conn_delete_from_tree(srv_conn, tid);
+                               DDPRINTF(stderr, "R");
                                HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
                        }
 
@@ -1776,6 +1785,7 @@ int be_reuse_connection(int64_t hash, struct session *sess,
                                 * to improve reuse rate, with a max retry limit.
                                 */
                                srv_conn = NULL;
+                               DDPRINTF(stderr, "\\");
                        }
                }
        }