-
Notifications
You must be signed in to change notification settings - Fork 190
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
disable stalled stream protection on empty bodies and after read complete #3644
Conversation
…been handed off to http layer
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
add tests for is_end_stream to ByteStream add tests for size_hint to ByteStream fix http_body_consumes_data test
A new generated diff is ready to view.
A new doc preview is ready to view. |
@@ -87,7 +87,7 @@ pub struct MinimumThroughputBodyOptionsBuilder { | |||
grace_period: Option<Duration>, | |||
} | |||
|
|||
const DEFAULT_GRACE_PERIOD: Duration = Duration::from_secs(0); | |||
const DEFAULT_GRACE_PERIOD: Duration = Duration::from_secs(20); |
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.
correctness: Is this the right one?
I also see
smithy-rs/rust-runtime/aws-smithy-runtime-api/src/client/stalled_stream_protection.rs
Line 16 in 22a0e30
const DEFAULT_GRACE_PERIOD: Duration = Duration::from_secs(5); |
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.
Whats the difference between these two? 🤔 , confusing that we have two constants for this..
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.
ah nuts, no wonder. Let's delete one.
A new generated diff is ready to view.
A new doc preview is ready to view. |
fix is_end_stream for 0 length PathBody that hasn't been polled
A new generated diff is ready to view.
A new doc preview is ready to view. |
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.
Based on our discussions the other day I think this covers everything besides the customization for S3 CopyObject
that we agreed to defer to another PR. One comment on a method name I found confusing but otherwise looks good!
/// | ||
/// After marking a stream complete [report](#method.report) will forever more return | ||
/// [ThroughputReport::Complete] | ||
pub(super) fn complete(&mut self) -> bool { |
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.
Could we name this mark_complete
or something to indicate that it has a side effect? When I saw this method used in UploadThroughput
I assumed it was just checking the completeness, not setting it. And with that the complete
method in UploadThroughput
should probably be renamed as well.
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.
heh it was originally named that, yeah I think thats fine
Since Landon mentioned it, here's the "No SSP for CopyObject" PR #3649 |
/// | ||
/// When a stream stalls for longer than this grace period, the stream will | ||
/// return an error. | ||
pub const DEFAULT_GRACE_PERIOD: Duration = Duration::from_secs(20); |
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.
why pub?
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.
b/c there's an SSP option struct in aws-smithy-runtime
that also has a default and I wanted a single source of truth.
use std::time::Duration; | ||
|
||
/// A collection of options for configuring a [`MinimumThroughputBody`](super::MinimumThroughputBody). | ||
/// A collection of options for configuring a [`MinimumThroughputBody`](super::MinimumThroughputDownloadBody). |
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.
this was correct as it was I think, it applies to MinimumThroughputBody
not just MinimumThroughputDownloadBody
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.
I did it to avoid the deprecation message:
/// Use [`MinimumThroughputDownloadBody`] instead.
#[deprecated(note = "Renamed to MinimumThroughputDownloadBody since it doesn't work for uploads")]
pub type MinimumThroughputBody<B> = MinimumThroughputDownloadBody<B>;
/// | ||
/// After marking a stream complete [report](#method.report) will forever more return | ||
/// [ThroughputReport::Complete] | ||
pub(super) fn complete(&mut self) -> bool { |
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.
heh it was originally named that, yeah I think thats fine
@@ -230,15 +233,18 @@ impl FsBuilder { | |||
enum State { | |||
Unloaded(PathBuf), | |||
Loading(Pin<Box<dyn Future<Output = io::Result<File>> + Send + Sync + 'static>>), | |||
Loaded(ReaderStream<io::Take<File>>), | |||
Loaded { |
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.
question: I assume this is the case but this gets reset correctly on a retry right?
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.
Yeah. The PathBody
is reconstructed from scratch each time.
@@ -36,6 +36,18 @@ references = ["aws-sdk-rust#1079"] | |||
meta = { "breaking" = false, "bug" = true, "tada" = false } | |||
author = "rcoh" | |||
|
|||
[[aws-sdk-rust]] | |||
message = "Fixes stalled upload stream protection to not apply to empty request bodies and to stop checking for violations once the request body has been read." | |||
references = ["aws-sdk-rust#1141", "aws-sdk-rust#1146", "aws-sdk-rust#1148"] |
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.
Will aws-sdk-rust#1141
(for CopyObject) and aws-sdk-rust#1146
(for MultipartUpload) be addressed by this PR?
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.
CopyObject is going to be resolved in a separate PR that I linked in an earlier post. MPU should be fixed by this PR.
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.
Gotcha, maybe we should remove aws-sdk-rust#1141
from references
then?
Co-authored-by: ysaito1001 <awsaito@amazon.com>
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.
nit
Co-authored-by: ysaito1001 <awsaito@amazon.com>
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
aws-sdk-sqs="1.23.0"
causing timeouts awslabs/aws-sdk-rust#1148Description
Testing
Additional integration tests added covering empty bodies and completed uploads.
Tested SQS issue against latest runtime and can see it works now. The S3
CopyObject
issue is related to downloads and will need a different solution.Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.