awslabs / awslabs/aws-sdk-rust
Adding a custom http client causes stall-stream protection to trigger if request takes too long
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 290
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 3
Description
### Describe the bug
I added a custom http client like this:
https://github.com/BoundaryML/baml/pull/1827/files#top
but then my requests to bedrock stopped failing if they took longer than 5s with:
```
DispatchFailure(
DispatchFailure {
source: ConnectorError {
kind: Timeout,
source: ThroughputBelowMinimum {
expected: Throughput {
bytes_read: 1,
per_time_elapsed: 1s,
},
actual: Throughput {
bytes_read: 0,
per_time_elapsed: 1s,
},
},
connection: Unknown,
},
},
)
```
To fix it I had to disable streamstall protection:
https://github.com/BoundaryML/baml/pull/1877/files
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Expected Behavior
Don't fail with a timeout
### Current Behavior
Fails with an error
### Reproduction Steps
Add a custom http client like in: https://github.com/BoundaryML/baml/pull/1827/files#top
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### Version
```text
1.85.0
```
### Environment details (OS name and version, etc.)
macos
### Logs
_No response_
Contributor guide
Research direction
Start by comparing the custom HTTP client setup in PR #1827 with the stream-stall protection disabled in PR #1877, then trace how the SDK applies stall-stream timeouts to Bedrock responses. Reproduce with the issue's macOS setup and version 1.85.0; done means a request taking longer than 5 seconds no longer fails solely with ThroughputBelowMinimum while protection remains appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100