Stalled-stream protection #956
Velfi
announced in
Change Log
Replies: 1 comment 2 replies
-
@Velfi I might be missing something here, but wasn't it a bit rash to make this an opt-out behavior? Some services like AWS transcribe will send out sparse data over websocket by design, suddenly starting to error out after 5 seconds with no data is a bit of a rug pull :) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is stalled stream protection?
When making HTTP calls, it's possible for a connection to 'stall out' and emit no more data due to server-side issues. In the event this happens, it's desirable for the stream to error out as quickly as possible. While timeouts can protect you from this issue, they aren't adaptive to the amount of data being sent and so must be configured specifically for each use case. When enabled, stalled-stream protection will ensure that bad streams error out quickly, regardless of the amount of data being
downloaded.
Protection is enabled by default for all clients but can be configured or disabled.
Configuring stalled stream protection
By default, stalled stream protection checks stream throughput once per second. If throughput is below 1B/s for longer than 5 seconds (the default grace period), then the stream will error out.
You can configure this grace period by modifying the SDK config:
Or by modifying the service config:
Disabling stalled stream protection
Just as in the previous examples, stalled stream can be disabled at the SDK config and service config levels:
Additionally, it's possible to disable stalled stream protection for uploads or downloads individually:
Configuring the "grace period"
By default, once a stream's transfer rate dips below the allowed limit for five seconds, it's cancelled and an error is returned. If this five-second grace period isn't a good fit for your workflow, you can change it or disable it:
Beta Was this translation helpful? Give feedback.
All reactions