Repository navigation
Conversation
…ream and pipeline #6208 made request() invoke onInfo through runInAsyncScope so that informational (1xx) responses are delivered in the requesting request's AsyncResource context. stream() and pipeline() still called onInfo directly, so on a shared connection the callback could observe the AsyncLocalStorage store of whichever request opened the connection. Wrap both calls in runInAsyncScope, matching request() and the other user callbacks in these handlers.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6267 +/- ##
=======================================
Coverage 91.78% 91.79%
=======================================
Files 113 113
Lines 44920 44920
=======================================
+ Hits 41230 41234 +4
+ Misses 3690 3686 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
#6208 fixed request() so that the onInfo callback for informational (1xx) responses runs in the AsyncResource context of the request that issued it. stream() and pipeline() were not updated and still called onInfo directly, so on a shared connection (for example several requests multiplexed over one HTTP/2 session) onInfo could observe the AsyncLocalStorage store of whichever request opened the connection.
This wraps both calls in runInAsyncScope, matching request() and the other user callbacks in these handlers, and adds regression tests for stream() and pipeline() over a shared HTTP/2 Client. The upgrade and connect handlers have no informational callback and already wrap their callbacks.