From: Willy Tarreau Date: Mon, 11 Oct 2021 07:49:03 +0000 (+0200) Subject: MINOR: stream: report the current rule in "show sess all" when known X-Git-Tag: v2.5-dev10~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1274e10d5c857b41d092c805b22d356e3d799aef;p=thirdparty%2Fhaproxy.git MINOR: stream: report the current rule in "show sess all" when known 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. --- diff --git a/src/stream.c b/src/stream.c index 18d4f122e7..162dfaa31b 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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;