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

Implement a new shared "Drainer" handler. #1517

Merged
merged 2 commits into from
Jul 18, 2020

Commits on Jul 17, 2020

  1. Implement a new shared "Drainer" handler.

    This implements a new `http.Handler` called `Drainer`, which is intended to wrap some inner `http.Handler` business logic with a new outer handler that can respond to Kubelet probes (successfully until told to "Drain()").
    
    This takes over the webhook's relatively new probe handling and lame duck logic with one key difference.  Previously the webhook waited for a fixed period after SIGTERM before exitting, but the new logic waits for this same grace period AFTER THE LAST REQUEST.  So if the handler keeps getting (non-probe) requests, the timer will continually reset, and once it stops receiving requests for the configured grace period, "Drain()" will return and the webhook will exit.
    
    The goal of this work is to try to better cope with what we believe to be high tail latencies of the API server seeing that a webhook replica is shutting down.
    
    Related: knative#1509
    mattmoor committed Jul 17, 2020
    Configuration menu
    Copy the full SHA
    f5a5626 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2020

  1. Switch to RWLock

    mattmoor committed Jul 18, 2020
    Configuration menu
    Copy the full SHA
    a08524c View commit details
    Browse the repository at this point in the history