awslabs / awslabs/aws-sdk-rust

Identity cache miss for static credentials

Open
#999 0 comments 7 reactions 0 assignees View on GitHub
bug p3
Dominant language
Rust
Stars
3.3k
Forks
290
Avg merge
1d 12h
Merged PRs (30d)
3

Description

### Describe the bug

I had a 19 hour process running uploading to S3 using the SDK with static non-expiring credentials, and over the course of that time, it logged an identity cache miss 80 times:
```
2023-12-10T00:15:57.659887Z INFO ThreadId(02) process:lazy_load_identity: aws_smithy_runtime::client::identity::cache::lazy: identity cache miss occurred; added new identity (took Ok(6.925µs))
```

### Expected Behavior

There shouldn't be cache misses for a static identity that doesn't have an expiration time.

### Current Behavior

See description.

### Reproduction Steps

Make somewhere on the order of 200,000 S3 PutObject requests over the course of 19 hours with:
```
config.credentials_provider(Credentials::new(
access_key_id,
secret_access_key,
None,
None,
"static",
));
```

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### Version

```text
├── aws-sdk-s3 v1.1.0
│ ├── aws-credential-types v1.0.1
│ │ ├── aws-smithy-async v1.0.1
│ │ ├── aws-smithy-runtime-api v1.0.1
│ │ │ ├── aws-smithy-async v1.0.1 (*)
│ │ │ ├── aws-smithy-types v1.0.1
│ │ ├── aws-smithy-types v1.0.1 (*)
│ ├── aws-http v0.60.0
│ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ ├── aws-smithy-types v1.0.1 (*)
│ │ ├── aws-types v1.0.1
│ │ │ ├── aws-credential-types v1.0.1 (*)
│ │ │ ├── aws-smithy-async v1.0.1 (*)
│ │ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ │ ├── aws-smithy-types v1.0.1 (*)
│ ├── aws-runtime v1.0.1
│ │ ├── aws-credential-types v1.0.1 (*)
│ │ ├── aws-http v0.60.0 (*)
│ │ ├── aws-sigv4 v1.0.1
│ │ │ ├── aws-credential-types v1.0.1 (*)
│ │ │ ├── aws-smithy-eventstream v0.60.0
│ │ │ │ ├── aws-smithy-types v1.0.1 (*)
│ │ │ ├── aws-smithy-http v0.60.0
│ │ │ │ ├── aws-smithy-eventstream v0.60.0 (*)
│ │ │ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ │ │ ├── aws-smithy-types v1.0.1 (*)
│ │ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ │ ├── aws-smithy-types v1.0.1 (*)
│ │ ├── aws-smithy-async v1.0.1 (*)
│ │ ├── aws-smithy-eventstream v0.60.0 (*)
│ │ ├── aws-smithy-http v0.60.0 (*)
│ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ ├── aws-smithy-types v1.0.1 (*)
│ │ ├── aws-types v1.0.1 (*)
│ ├── aws-sigv4 v1.0.1 (*)
│ ├── aws-smithy-async v1.0.1 (*)
│ ├── aws-smithy-checksums v0.60.0
│ │ ├── aws-smithy-http v0.60.0 (*)
│ │ ├── aws-smithy-types v1.0.1 (*)
│ ├── aws-smithy-eventstream v0.60.0 (*)
│ ├── aws-smithy-http v0.60.0 (*)
│ ├── aws-smithy-json v0.60.0
│ │ └── aws-smithy-types v1.0.1 (*)
│ ├── aws-smithy-runtime v1.0.1
│ │ ├── aws-smithy-async v1.0.1 (*)
│ │ ├── aws-smithy-http v0.60.0 (*)
│ │ ├── aws-smithy-protocol-test v0.60.0
│ │ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ ├── aws-smithy-runtime-api v1.0.1 (*)
│ │ ├── aws-smithy-types v1.0.1 (*)
│ ├── aws-smithy-runtime-api v1.0.1 (*)
│ ├── aws-smithy-types v1.0.1 (*)
│ ├── aws-smithy-xml v0.60.0
│ ├── aws-types v1.0.1 (*)
├── aws-smithy-async v1.0.1 (*)
├── aws-credential-types v1.0.1 (*)
├── aws-runtime v1.0.1 (*)
├── aws-smithy-runtime v1.0.1 (*)
```

### Environment details (OS name and version, etc.)

Linux

### Logs

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the `lazy_load_identity` cache path from the logged cache-miss message and the `credentials_provider` setup using static `Credentials`. Reproduce the behavior with repeated S3 `PutObject` requests and verify that a non-expiring static identity remains cached without repeated misses.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, rust
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.