From db76db93af84c93ef7e7832d5f930ae793ec61ef Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 24 Mar 2023 14:55:17 -0700 Subject: [PATCH] Fix lack of the `Sync` auto trait on event stream outputs (#2496) --- CHANGELOG.next.toml | 14 +++++++++++++- .../aws-smithy-http/src/event_stream/receiver.rs | 10 +++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index fc4c4c2578..eff610036e 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -9,4 +9,16 @@ # 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" \ No newline at end of file +# author = "rcoh" + +[[aws-sdk-rust]] +message = "The outputs for event stream operations (for example, S3's SelectObjectContent) now implement the `Sync` auto-trait." +references = ["smithy-rs#2496"] +meta = { "breaking" = false, "tada" = false, "bug" = true } +author = "jdisanti" + +[[smithy-rs]] +message = "The outputs for event stream operations now implement the `Sync` auto-trait." +references = ["smithy-rs#2496"] +meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "all"} +author = "jdisanti" diff --git a/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs b/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs index 9d6a3bc398..aa7f914223 100644 --- a/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs +++ b/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs @@ -128,7 +128,7 @@ impl StdError for ReceiverError {} /// Receives Smithy-modeled messages out of an Event Stream. #[derive(Debug)] pub struct Receiver { - unmarshaller: Box + Send>, + unmarshaller: Box + Send + Sync>, decoder: MessageFrameDecoder, buffer: RecvBuf, body: SdkBody, @@ -143,7 +143,7 @@ pub struct Receiver { impl Receiver { /// Creates a new `Receiver` with the given message unmarshaller and SDK body. pub fn new( - unmarshaller: impl UnmarshallMessage + Send + 'static, + unmarshaller: impl UnmarshallMessage + Send + Sync + 'static, body: SdkBody, ) -> Self { Receiver { @@ -548,10 +548,10 @@ mod tests { ); } - fn assert_send() {} + fn assert_send_and_sync() {} #[tokio::test] - async fn receiver_is_send() { - assert_send::>(); + async fn receiver_is_send_and_sync() { + assert_send_and_sync::>(); } }