Skip to content

Commit

Permalink
Fix OperationExtensionFuture poll order (#2247)
Browse files Browse the repository at this point in the history
* Fix `OperationExtensionFuture` poll order

* Add CHANGELOG.next.toml entry

Co-authored-by: AWS SDK Rust Bot <[email protected]>
  • Loading branch information
hlbarber and aws-sdk-rust-ci authored Jan 25, 2023
1 parent d301e65 commit ebdf597
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit ebdf597

Please sign in to comment.