-
Notifications
You must be signed in to change notification settings - Fork 192
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
Port middleware connectors to the orchestrator #2970
Conversation
bb69697
to
0c038ca
Compare
0c038ca
to
cc98dfd
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
rust-runtime/aws-smithy-runtime/src/client/connectors/test_util/dvr/record.rs
Outdated
Show resolved
Hide resolved
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.
Thanks for converting all of these.
Co-authored-by: Zelda Hessler <[email protected]>
author = "jdisanti" | ||
|
||
[[smithy-rs]] | ||
message = "TestConnection was renamed to EventConnector." |
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.
Although I agree the name is a little more descriptive, we should probably introduce some sort of table-of-contents of test connections
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.
Good call. Added in 17a518c
CHANGELOG.next.toml
Outdated
|
||
[[smithy-rs]] | ||
message = "`aws_smithy_client::hyper_ext::Adapter` was moved/renamed to `aws_smithy_runtime::client::connectors::hyper_connector::HyperConnector`." | ||
references = ["smithy-rs#2970"] | ||
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" } | ||
author = "jdisanti" | ||
|
||
[[smithy-rs]] | ||
message = "Test connectors moved into `aws_smithy_runtime::client::connectors::test_util` behind the `test-util` feature." | ||
references = ["smithy-rs#2970"] | ||
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" } | ||
author = "jdisanti" | ||
|
||
[[smithy-rs]] | ||
message = "DVR's RecordingConnection and ReplayingConnection were renamed to RecordingConnector and ReplayingConnector respectively." | ||
references = ["smithy-rs#2970"] | ||
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" } | ||
author = "jdisanti" | ||
|
||
[[smithy-rs]] | ||
message = "TestConnection was renamed to EventConnector." | ||
references = ["smithy-rs#2970"] | ||
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" } | ||
author = "jdisanti" |
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.
can we add a doc explaining the difference between Connection
and Connector
?
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.
Talked about in 17a518c
/// Boxed future used by [`HttpConnectorFuture`]. | ||
pub type BoxFuture = Pin<Box<dyn StdFuture<Output = Result<HttpResponse, ConnectorError>> + Send>>; | ||
/// Future for [`HttpConnector::call`]. | ||
pub type HttpConnectorFuture = NowOrLater<Result<HttpResponse, ConnectorError>, BoxFuture>; |
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.
what if we introduce a new-type future instead? That seems like it would afford us more API evolution in the future
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.
Introduced in 8eb9923
Ok(http::Response::builder() | ||
.status(200) | ||
.header("rp1", "1") | ||
.body(SdkBody::empty()) | ||
.unwrap()) | ||
}) | ||
})) | ||
} | ||
} | ||
|
||
// CN2, the outer connector, calls the inner connector and adds the `rp2` header to the response | ||
#[derive(Debug)] | ||
struct CN2(SharedHttpConnector); |
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.
cn2 sounds like a protocol but I guess this is a test connector? maybe should be renamed Connector2
or something
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.
Renamed in 8eb9923
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. |
Draft pull request pending merge of #2970 ## Motivation and Context - awslabs/aws-sdk-rust#738 - awslabs/aws-sdk-rust#858 <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> ## Description <!--- Describe your changes in detail --> This PR adds two additional classes of retries tested: 1. GO_AWAY: awslabs/aws-sdk-rust#738 2. REFUSED_STREAM: awslabs/aws-sdk-rust#858 I tested 1 by using the example helpfully provided. The fix for 2 is untested and difficult to reproduce but since my fix for 1 worked, I'm confident that we're detecting the correct error class here. ## Testing I used the example provided by the customer and validated the H2 GO_AWAY fix. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [ ] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [ ] 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._
This PR ports all the connectors from the
aws-smithy-client
crate intoaws-smithy-runtime
implementing the newHttpConnector
trait. The old connectors are left in place for now, and follow up PRs will remove them as well as revise the generated configs to takeHttpConnector
impls rather thanDynConnector
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.