From: Willy Tarreau Date: Fri, 1 May 2020 14:57:02 +0000 (+0200) Subject: MINOR: stream: report the list of active filters on stream crashes X-Git-Tag: v2.2-dev7~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9753d61288936db804628c1e0bad20b7593ad384;p=thirdparty%2Fhaproxy.git MINOR: stream: report the list of active filters on stream crashes Now we very rarely catch spinning streams, and whenever we catch one it seems a filter is involved, but we currently report no info about them. Let's print the list of enabled filters on the stream with such a crash to help with the reports. A typical output will now look like this: [ALERT] 121/165908 (1110) : A bogus STREAM [0x7fcaf4016a60] is spinning at 2 calls per second and refuses to die, aborting now! Please report this error to developers [strm=0x7fcaf4016a60 src=127.0.0.1 fe=l1 be=l1 dst= rqf=6dc42000 rqa=48000 rpf=a0040223 rpa=24000000 sif=EST,10008 sib=DIS,80110 af=(nil),0 csf=0x7fcaf4023c00,10c000 ab=0x7fcaf40235f0,4 csb=(nil),0 cof=0x7fcaf4016610,1300:H1(0x7fcaf4016840)/RAW((nil))/tcpv4(29) cob=(nil),0:NONE((nil))/NONE((nil))/NONE(0) filters={0x7fcaf4016fb0="cache store filter", 0x7fcaf4017080="compression filter"}] This may be backported to 2.0. --- diff --git a/src/stream.c b/src/stream.c index 8b9d885e74..4822387d61 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2666,6 +2666,19 @@ void stream_dump_and_crash(enum obj_type *obj, int rate) chunk_reset(&trash); stream_dump(&trash, s, "", ' '); + + chunk_appendf(&trash, "filters={"); + if (HAS_FILTERS(s)) { + struct filter *filter; + + list_for_each_entry(filter, &s->strm_flt.filters, list) { + if (filter->list.p != &s->strm_flt.filters) + chunk_appendf(&trash, ", "); + chunk_appendf(&trash, "%p=\"%s\"", filter, FLT_ID(filter)); + } + } + chunk_appendf(&trash, "}"); + memprintf(&msg, "A bogus %s [%p] is spinning at %d calls per second and refuses to die, " "aborting now! Please report this error to developers "