Files
seaweedfs/weed/s3api
9c214d0ff5 kms: close replaced providers after a grace period (#13359)
* 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>
2026-12-03 23:14:53 -08:00
..
2024-07-04 11:00:41 -07:00

see https://blog.aqwari.net/xml-schema-go/

1. go get aqwari.net/xml/cmd/xsdgen
2. Add EncodingType element for ListBucketResult in AmazonS3.xsd
3. xsdgen -o s3api_xsd_generated.go -pkg s3api AmazonS3.xsd
4. Remove empty Grantee struct in s3api_xsd_generated.go
5. Remove xmlns: sed s'/http:\/\/s3.amazonaws.com\/doc\/2006-03-01\/\ //' s3api_xsd_generated.go