-
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
Enable stalled stream protection for uploads behind new behavior version #3527
Enable stalled stream protection for uploads behind new behavior version #3527
Conversation
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.
lgtm, couple of inline comments
.with_config(layer("default_stalled_stream_protection_config", |layer| { | ||
layer.store_put( | ||
StalledStreamProtectionConfig::enabled() | ||
// TODO(https://github.com/smithy-lang/smithy-rs/issues/3510): enable behind new behavior version | ||
.upload_enabled(false) | ||
.grace_period(Duration::from_secs(5)) | ||
.build(), | ||
); | ||
let mut config = | ||
StalledStreamProtectionConfig::enabled().grace_period(Duration::from_secs(5)); | ||
// Before v2024_03_28, upload streams did not have stalled stream protection by default | ||
if !behavior_version.is_at_least(BehaviorVersion::v2024_03_28()) { | ||
config = config.upload_enabled(false); | ||
} | ||
layer.store_put(config.build()); |
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.
for debuggability, I wonder if we should alter the name of the plugin.
I would probably make two separate plugins that we select based on BMV instead, may be clearer and less likely to accidentally regress. That said, I don't have strong feelings.
// Stalled stream protection MUST BE enabled by default. Do not configure it explicitly. | ||
.credentials_provider(Credentials::for_tests()) | ||
.region(Region::new("us-east-1")) | ||
.endpoint_url(format!("http://{server_addr}")) | ||
// TODO(https://github.com/smithy-lang/smithy-rs/issues/3510): make stalled stream protection enabled by default with BMV and remove this line | ||
.stalled_stream_protection(StalledStreamProtectionConfig::enabled().build()) | ||
.build(); |
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.
should we copy one of these tests, use the older BMV, and validate that stalled stream upload protection is not enabled?
CHANGELOG.next.toml
Outdated
@@ -70,3 +70,15 @@ message = "Stalled stream protection on downloads will now only trigger if the u | |||
references = ["smithy-rs#3485"] | |||
meta = { "breaking" = false, "tada" = false, "bug" = true } | |||
author = "jdisanti" | |||
|
|||
[[smithy-rs]] | |||
message = "Stalled stream protection on uploads is now enabled by default behind `BehaviorVersion::v2024_03_28()`. If you're using `BehaviorVersion::latest()`, you will get this change automatically by updating." |
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.
message = "Stalled stream protection on uploads is now enabled by default behind `BehaviorVersion::v2024_03_28()`. If you're using `BehaviorVersion::latest()`, you will get this change automatically by updating." | |
message = "Stalled stream protection on uploads is now enabled by default behind `BehaviorVersion::v2024_03_28()`. If you're using `BehaviorVersion::latest()`, you will get this change automatically by running `cargo update`. Updating your SDK is not necessary, this change will happen when a new version of the client libraries are consumed." |
/// | ||
/// Over time, new best-practice behaviors are introduced. However, these behaviors might not be | ||
/// backwards compatible. For example, a change which introduces new default timeouts or a new | ||
/// retry-mode for all operations might be the ideal behavior but could break existing applications. | ||
#[derive(Clone)] | ||
#[derive(Copy, Clone, PartialEq)] | ||
pub struct BehaviorVersion { |
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.
We should probably add a section to the developer guide on behavior versions, what they are and guidance on how to choose, and what changed in each.
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.
e6ee189
to
477d1d5
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> Original issue: #3427 RFC: #3544 ## Description <!--- Describe your changes in detail --> Fixes the `SharedCredentialsProvider` and `SharedTokenProvider` to re-use a consistent cache partition by default. `SdkConfig` does not create an identity cache by default still, that will need to be a follow on PR that gates it behind a new behavior version. Ideally we do that with the stalled stream protection work in #3527 ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Added new unit and integration tests. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [X] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
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. |
## Motivation and Context This PR is the combination of two previously reviewed PRs that both enable new behaviors behind a new Behavior Major Version (BMV): * #3527 * #3578 ## Description * Enables stalled stream protection by default on latest behavior version. * Enables creation of a default identity cache. ## Testing All testing done on prior PRs. See for details. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <[email protected]> Co-authored-by: ysaito1001 <[email protected]>
This PR is the combination of two previously reviewed PRs that both enable new behaviors behind a new Behavior Major Version (BMV): * smithy-lang#3527 * smithy-lang#3578 * Enables stalled stream protection by default on latest behavior version. * Enables creation of a default identity cache. All testing done on prior PRs. See for details. <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <[email protected]> Co-authored-by: ysaito1001 <[email protected]>
## Motivation and Context This PR is the combination of two previously reviewed PRs that both enable new behaviors behind a new Behavior Major Version (BMV): * smithy-lang/smithy-rs#3527 * smithy-lang/smithy-rs#3578 ## Description * Enables stalled stream protection by default on latest behavior version. * Enables creation of a default identity cache. ## Testing All testing done on prior PRs. See for details. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <[email protected]> Co-authored-by: ysaito1001 <[email protected]>
This PR creates a new behavior version that enables stalled stream protection for upload streams by default.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.