From 1274e10d5c857b41d092c805b22d356e3d799aef Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 11 Oct 2021 09:49:03 +0200 Subject: [PATCH] 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. --- src/stream.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stream.c b/src/stream.c index 18d4f12..162dfaa 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; -- 1.7.10.4