Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h2: Make requests walk away from the waiting list #3835

Closed
wants to merge 5 commits into from

Commits on Oct 19, 2022

  1. transport: Add a waiting list methods for req_top

    It comes with new functions hsh_waitlist() and hsh_reembark() that
    centralize the logic. The top_waitlist() and top_reembark() methods
    are meant for client-facing transport to register when requests and
    sub-requests alike enter and leave a waiting list.
    dridi committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    808c673 View commit details
    Browse the repository at this point in the history
  2. transport: Remove the vtr_reembark_f typedef

    Since both vtr_reembark_f and vtr_waitlist_f have the same signature, we
    can use vtr_waitlist_f to convey that those callbacks relate to waiting
    lists, and the name of the methods to convey their roles.
    dridi committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    9200141 View commit details
    Browse the repository at this point in the history
  3. hash: New HSH_WalkAway() function

    When there's no rush, a request can simply walk away from the queue.
    
    The concept is simple: when a factor (pun intended) other than the
    backend fetch requires the request to leave the queue, it can just
    walk away. It short-circuits the usual rush exit.
    
    We can repurpose the dead counter busy_killed to count those events,
    and get rid of the dead enum entry HSH_CONTINUE.
    dridi committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    7d53b8b View commit details
    Browse the repository at this point in the history
  4. h2: Keep track of streams entering waiting lists

    But operate on a different objhead reference guarded by the h2_sess lock
    instead. This will allow coordination with the h2 session thread.
    dridi committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    2e9bcc3 View commit details
    Browse the repository at this point in the history
  5. h2: Make requests walk away from the waiting list

    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.
    
    Better diff with the --ignore-all-space option.
    dridi committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    f6ebc5a View commit details
    Browse the repository at this point in the history