Skip Automatic Context Propagation in special operators#3845
Merged
Conversation
048d8e3 to
9fead48
Compare
This change should improve performance of Automatic Context Propagation in certain cases when doOnDiscard, onErrorContinue, and onErrorStop are used. The context-propagation integration requires contextWrite and tap operators to be barriers for restoring ThreadLocal values. Some internal usage of contextWrite does not require us to treat the operators the same way and we can skip the ceremony of restoring ThreadLocal state as we know that no ThreadLocalAccessor can be registered for them. Therefore, a private variant is introduced to avoid unnecessary overhead when not required. Related #3840
9fead48 to
b125b40
Compare
violetagg
approved these changes
Jul 12, 2024
Member
Author
|
@violetagg thank you for the review! |
chemicL
added a commit
that referenced
this pull request
Jul 12, 2024
9 tasks
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.
This change should improve performance of Automatic Context Propagation in certain cases when
doOnDiscard,onErrorContinue, andonErrorStopare used.The context-propagation integration requires
contextWriteandtapoperators to be barriers for restoringThreadLocalvalues. Some internal usage ofcontextWritedoes not require us to treat the operators the same way and we can skip the ceremony of restoringThreadLocalstate as we know that noThreadLocalAccessorcan be registered for them. Therefore, a private variant is introduced to avoid unnecessary overhead when not required.Related #3840