-
Notifications
You must be signed in to change notification settings - Fork 466
feat(catalog): avoid static global credentials provider #2684
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
Conversation
Refactors `CredentialProviderHolder` to prevent "Connection Pool Shutdown" errors by creating a new provider instance for each catalog. Previously, a single static `AwsCredentialsProvider` was shared globally. If this provider was closed, it would affect all subsequent operations. By creating a new provider on each `create()` call from Iceberg, this change removes the global singleton and isolates provider instances. Fixes #2680
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the CredentialProviderHolder
class to eliminate the use of a static global credentials provider singleton and instead create a new provider instance on each create()
method invocation. This change prevents "Connection Pool Shutdown" errors that occur when a shared static AWS credentials provider is closed, affecting all subsequent operations.
- Removed static
provider
field and replaced withbucketURI
storage - Modified
create()
method to invokeproviderSupplier.apply(bucketURI)
for fresh provider instances - Updated
setup(BucketURI)
method to store thebucketURI
instead of creating a provider immediately
….java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Gezi-lzq <lzqtxwd@gmail.com>
…use builder pattern
* feat(catalog): Avoid static global credentials provider Refactors `CredentialProviderHolder` to prevent "Connection Pool Shutdown" errors by creating a new provider instance for each catalog. Previously, a single static `AwsCredentialsProvider` was shared globally. If this provider was closed, it would affect all subsequent operations. By creating a new provider on each `create()` call from Iceberg, this change removes the global singleton and isolates provider instances. Fixes #2680 * Update core/src/main/java/kafka/automq/table/CredentialProviderHolder.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Gezi-lzq <lzqtxwd@gmail.com> * fix(credentials): update DefaultCredentialsProvider instantiation to use builder pattern --------- Signed-off-by: Gezi-lzq <lzqtxwd@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat(catalog): Avoid static global credentials provider Refactors `CredentialProviderHolder` to prevent "Connection Pool Shutdown" errors by creating a new provider instance for each catalog. Previously, a single static `AwsCredentialsProvider` was shared globally. If this provider was closed, it would affect all subsequent operations. By creating a new provider on each `create()` call from Iceberg, this change removes the global singleton and isolates provider instances. Fixes #2680 * Update core/src/main/java/kafka/automq/table/CredentialProviderHolder.java * fix(credentials): update DefaultCredentialsProvider instantiation to use builder pattern --------- Signed-off-by: Gezi-lzq <lzqtxwd@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refactors CredentialProviderHolder to prevent "Connection Pool Shutdown" errors by creating a new provider instance upon each invocation of create().
Previously, a single static
AwsCredentialsProvider
was shared globally. If this provider was closed, it would affect all subsequent operations. By creating a new provider on eachcreate()
call from Iceberg, this change removes the global singleton and isolates provider instances.Fixes #2680
apache/iceberg#8677