Repository navigation
fix: Keep TransportBuilder Send and Sync - #518
Merged
reta merged 1 commit intoNov 13, 2026
Merged
Conversation
ClientInitializer had no Send or Sync bound, so the boxed initializers stored in TransportBuilder made the builder neither Send nor Sync, even when no initializer was added. A builder held across .await could no longer be moved into a spawned task, which worked in 2.x. Require Send + Sync on ClientInitializer and its closure impl, as RequestInitializer and RequestHandler already do, and test that TransportBuilder and Transport are Send + Sync. Signed-off-by: Takuo Kuroki <kurotaku9679.sub@gmail.com>
krocky-cooky
requested review from
VachaShah,
Xtansia and
reta
as code owners
November 13, 2026 10:12
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #518 +/- ##
==========================================
+ Coverage 44.30% 46.91% +2.60%
==========================================
Files 569 569
Lines 169350 170879 +1529
==========================================
+ Hits 75030 80165 +5135
+ Misses 94320 90714 -3606
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
reta
approved these changes
Nov 13, 2026
reta
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @krocky-cooky ! Indeed, looks like a regression against 2.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TransportBuilderstopped beingSendandSyncwhen the middleware types were added (#232): it stores its client initializers as boxedClientInitializers, and that trait had noSendorSyncbound. The builder lost both auto traits even without any initializer, so a builder held across.awaitcould no longer be moved into a spawned task, which worked in 2.x.This PR requires
Send + SynconClientInitializerand on its closure impl, asRequestInitializerandRequestHandleralready do. Initializers capturing non-thread-safe state (e.g. anRc) are no longer accepted; since middleware is unreleased, no released code is affected.Tests
TransportBuilderandTransportareSend + Sync(a compile-time check, so a regression fails the build).Testing
cargo test -p opensearch --lib http::: 32 passed; transport doc tests: 5 passed.cargo fmt --checkclean; no new clippy warnings.Issues Resolved
Closes #517.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 License.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.