varnish-cache icon indicating copy to clipboard operation
varnish-cache copied to clipboard

h2: Make requests walk away from the waiting list

Open dridi opened this issue 1 year ago • 2 comments

When a session goes to the cleanup step, it will indefinitely try to kill all the streams until those stuck in a waiting list reembark a thread. This can lead to clients timing out, closing the h2 session, and opening a new h2 session for the exact same requests. This can artifically inflate the number of dead tasks in a waiting list with generous backend timeouts.

To avoid that, an h2 stream will keep a list of requests currently in a waiting list and make them walk away quietly during cleanup. An h2 stream would normally only have one request running at any time but this may no longer be true with modules like vmod_pesi.


See https://varnish-cache.org/lists/pipermail/varnish-misc/2022-July/027160.html

This is equivalent to what we have in Varnish Enterprise that I mentioned in this thread. It does not solve the problem described in the email thread, because we have no path to walk away from an HTTP/1 request (pun intended).

I believe we could potentially solve the HTTP/1 case if we involved a waiter that would only care about closed connections, ignoring incoming data that I believe trigger a wake up today.

I am convinced that I managed a better design than the original attempt, and I'm looking forward to reviews. Unfortunately, I will miss the next two bugwash meetings.

dridi avatar Aug 12 '22 14:08 dridi

generally in favor, have not looked closer yet, still :(

nigoroll avatar Aug 29 '22 13:08 nigoroll

Rebased against current master to solve the trivial merge conflict. I switched to more explicit tansport::top_*() methods as suggested. Not addressing other review items, yet.

dridi avatar Sep 15 '22 09:09 dridi

Closing for now because #3992 will pull the objhead rug pretty hard.

dridi avatar Sep 28 '23 06:09 dridi