Skip to content

Finalize and desynchronize expiring-storage cleanup timers #2223

Description

@jeswr

Feature description

WrappedExpiringStorage creates a periodic expiry-sweep interval and calls unref() on it, but the timer is never cleared during graceful server shutdown. The four default instances are not part of the application finalizer chain.

Make the storage finalizable, register each default instance with the server finalizer, and clear its timer during finalization. The instances are constructed together and each sweep enumerates its backing store, so also add a small configurable jitter to avoid all four sweeps firing at the same instant. Existing constructor calls and configurations should remain compatible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions