mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
* kms: close replaced providers after a grace period A reload closed each provider it replaced or removed right away, while S3 requests that had fetched it just before could still be using it. Those requests failed. A replaced or removed provider now stays open for a grace period of a minute and is then closed once, however often it was retired. The manager's Close closes the ones still waiting. The global provider is now the manager's default one, looked up on each use, so a reload can't leave it pointing at a closed instance. A provider set with SetGlobalKMSProvider still takes its place until the next load, which clears it. Passing nil hands it back to the manager's default, where before it turned KMS off until the next load. While a retired provider is global, its retirement is held with no timer, and it starts again once it isn't. SetGlobalKMSProvider no longer closes the provider it replaces, since the caller owns what it passes. A provider InitializeGlobalKMS created belongs to the package, so it's closed once another global provider replaces it. The manager's Close clears the global provider if it's one the manager closes, so it isn't used closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kms: read the global override and the default provider under one lock Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kms: check the replaced global instance is held before unsetting it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * kms/openbao: close the reload test's providers through the manager Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>