]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream: report the current rule in "show sess all" when known
authorWilly Tarreau <w@1wt.eu>
Mon, 11 Oct 2021 07:49:03 +0000 (09:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 12 Oct 2021 05:38:30 +0000 (07:38 +0200)
Sometimes an HTTP or TCP rule may take time to complete because it is
waiting for external data (e.g. "wait-for-body", "do-resolve"), and it
can be useful to report the action and the location of that rule in
"show sess all". Here for streams blocked on such a rule, there will
now be a "current_line" extra line reporting this. Note that this does
not catch rulesets which are re-evaluated from the start on each change
(e.g. tcp-request content waiting for changes) but only when a specific
rule is being paused.

src/stream.c

index 18d4f122e77af6e2f5855aad5cc701dade0de291..162dfaa31bd1840201682bb281d5979224bf428f 100644 (file)
@@ -3421,6 +3421,11 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                                      (unsigned long long)htx->extra);
                }
 
+               if (strm->current_rule_list && strm->current_rule) {
+                       const struct act_rule *rule = strm->current_rule;
+                       chunk_appendf(&trash, "      current_rule=\"%s\" [%s:%d]\n", rule->kw->kw, rule->conf.file, rule->conf.line);
+               }
+
                if (ci_putchk(si_ic(si), &trash) == -1)
                        goto full;