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

vault: expired tokens count toward batch limit #8553

Merged
merged 1 commit into from
Jul 29, 2020

Commits on Jul 28, 2020

  1. vault: expired tokens count toward batch limit

    As of 0.11.3 Vault token revocation and purging was done in batches.
    However the batch size was only limited by the number of *non-expired*
    tokens being revoked.
    
    Due to bugs prior to 0.11.3, *expired* tokens were not properly purged.
    Long-lived clusters could have thousands to *millions* of very old
    expired tokens that never got purged from the state store.
    
    Since these expired tokens did not count against the batch limit, very
    large batches could be created and overwhelm servers.
    
    This commit ensures expired tokens count toward the batch limit with
    this one line change:
    
    ```
    - if len(revoking) >= toRevoke {
    + if len(revoking)+len(ttlExpired) >= toRevoke {
    ```
    
    However, this code was difficult to test due to being in a periodically
    executing loop. Most of the changes are to make this one line change
    testable and test it.
    schmichael committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    4a14604 View commit details
    Browse the repository at this point in the history