]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2/show_fd: report as suspicious an entry with too many calls
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Jan 2021 08:13:35 +0000 (09:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 21 Jan 2021 08:17:42 +0000 (09:17 +0100)
An FD entry that maps to an H2C connection whose last stream was woken
up more than 1M times is now flagged as suspicious.

src/mux_h2.c

index 2fbf19675dabe77a48d005d899d269f98bee737b..fd03ea8c4600fd1e09e4df69e1b140ddde99ac2a 100644 (file)
@@ -6202,9 +6202,10 @@ static int h2_show_fd(struct buffer *msg, struct connection *conn)
        int tree_cnt = 0;
        int orph_cnt = 0;
        struct buffer *hmbuf, *tmbuf;
+       int ret = 0;
 
        if (!h2c)
-               return 0;
+               return ret;
 
        list_for_each_entry(h2s, &h2c->fctl_list, list)
                fctl_cnt++;
@@ -6257,12 +6258,14 @@ static int h2_show_fd(struct buffer *msg, struct connection *conn)
                                chunk_appendf(&trash, " tl.calls=%d tl.ctx=%p tl.fct=",
                                              h2s->subs->tasklet->calls,
                                              h2s->subs->tasklet->context);
+                               if (h2s->subs->tasklet->calls >= 1000000)
+                                       ret = 1;
                                resolve_sym_name(&trash, NULL, h2s->subs->tasklet->process);
                                chunk_appendf(&trash, ")");
                        }
                }
        }
-       return 0;
+       return ret;
 }
 
 /* Migrate the the connection to the current thread.