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

Fix OperationExtensionFuture poll order #2247

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@
# message = "Fix typos in module documentation for generated crates"
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "client | server | all"}
# author = "rcoh"
# author = "rcoh"

[[smithy-rs]]
message = "Fix bug in `OperationExtensionFuture`s `Future::poll` implementation"
references = ["smithy-rs#920"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "server"}
author = "hlbarber"
2 changes: 1 addition & 1 deletion rust-runtime/aws-smithy-http-server/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ where

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
let resp = ready!(this.inner.try_poll(cx));
let ext = this
.operation_extension
.take()
.expect("futures cannot be polled after completion");
let resp = ready!(this.inner.try_poll(cx));
Poll::Ready(resp.map(|mut resp| {
resp.extensions_mut().insert(ext);
resp
Expand Down