delta-io / delta-rs

A native Rust library for Delta Lake, with bindings into Python
https://delta-io.github.io/delta-rs/
Apache License 2.0
2.34k stars 414 forks source link

fix: cache credential resolution with the AWS credential provider #2987

Closed rtyler closed 1 week ago

rtyler commented 1 week ago

object_store invokes get_credential on every invocation of a get/list/put/etc. The provider invocation for environment based credentials is practically zero-cost, so this has no/low overhead.

In the case of the AssumeRoleProvider or any provider which has some cost, such as an invocation of the AWS STS APIs, this can result in rate-limiting or service quota exhaustion.

In order to prevent this, the credentials are attempted to be cached only so long as they have no expired, which is defined in the aws_credential_types::Credential struct

Sponsored-by: Scribd Inc

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 84.14634% with 13 lines in your changes missing coverage. Please review.

Project coverage is 72.33%. Comparing base (b4eff70) to head (3a25235). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/aws/src/credentials.rs 84.14% 0 Missing and 13 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2987 +/- ## ========================================== + Coverage 72.27% 72.33% +0.06% ========================================== Files 128 128 Lines 40341 40420 +79 Branches 40341 40420 +79 ========================================== + Hits 29155 29237 +82 + Misses 9335 9305 -30 - Partials 1851 1878 +27 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.