]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2: add the expire task and its expiration date in "show fd"
authorWilly Tarreau <w@1wt.eu>
Tue, 29 Nov 2022 14:26:43 +0000 (15:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Nov 2022 14:29:00 +0000 (15:29 +0100)
Some issues such as #1929 seem to involve a task without timeout but we
can't find the condition to reproduce this in the code. However, not having
this info in the output doesn't help, so this patch adds the task pointer
and its timeout (when the task is non-null). It may be useful to backport
it.

src/mux_h2.c

index fc484f82b9dd966512cadd324f1b2e46f016747a..ac7afcd2a6bc9aae499f46bbbd8c7161302b6514 100644 (file)
@@ -6594,6 +6594,12 @@ static int h2_dump_h2c_info(struct buffer *msg, struct h2c *h2c, const char *pfx
                      (unsigned int)b_data(tmbuf), b_orig(tmbuf),
                      (unsigned int)b_head_ofs(tmbuf), (unsigned int)b_size(tmbuf));
 
+       chunk_appendf(msg, " .task=%p", h2c->task);
+       if (h2c->task) {
+               chunk_appendf(msg, " .exp=%s",
+                             h2c->task->expire ? tick_is_expired(h2c->task->expire, now_ms) ? "<PAST>" :
+                             human_time(TICKS_TO_MS(h2c->task->expire - now_ms), TICKS_TO_MS(1000)) : "<NEVER>");
+       }
 
        return ret;
 }