Skip to content
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

Merged
merged 9 commits into from Apr 24, 2024

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Mar 27, 2024

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.

@jdisanti jdisanti marked this pull request as ready for review March 27, 2024 23:35
@jdisanti jdisanti requested review from a team as code owners March 27, 2024 23:35
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Collaborator

@rcoh rcoh left a 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

Comment on lines 194 to +201
.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());
Copy link
Collaborator

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.

Comment on lines +95 to 99
// 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();
Copy link
Collaborator

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?

@@ -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."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 {
Copy link
Contributor

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.

Copy link
Collaborator Author

@jdisanti jdisanti Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aajtodd aajtodd mentioned this pull request Apr 5, 2024
1 task
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

github-merge-queue bot pushed a commit that referenced this pull request Apr 10, 2024
## 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._
@jdisanti jdisanti removed the blocked label Apr 12, 2024
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@jdisanti jdisanti changed the base branch from main to behavior-version-2024-03-28 April 24, 2024 19:20
@jdisanti jdisanti merged commit 510ce11 into behavior-version-2024-03-28 Apr 24, 2024
44 checks passed
@jdisanti jdisanti deleted the jdisanti-bmv-stall-uploads branch April 24, 2024 19:20
@aajtodd aajtodd mentioned this pull request Apr 30, 2024
2 tasks
github-merge-queue bot pushed a commit that referenced this pull request May 2, 2024
## 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 <jdisanti@amazon.com>
Co-authored-by: ysaito1001 <awsaito@amazon.com>
ogghead pushed a commit to ogghead/smithy-rs that referenced this pull request May 5, 2024
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 <jdisanti@amazon.com>
Co-authored-by: ysaito1001 <awsaito@amazon.com>
aws-sdk-rust-ci pushed a commit to awslabs/aws-sdk-rust that referenced this pull request May 8, 2024
## 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 <jdisanti@amazon.com>
Co-authored-by: ysaito1001 <awsaito@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants