Fix Ratpack server context propagation and enable its concurrency test - #2910
Merged
Merged
Conversation
agoallikmaa
requested review from
anuraaga,
iNikem,
jkwatson,
laurit,
mateuszrzeszutek,
pavolloffay,
trask and
tylerbenson
as code owners
May 5, 2021 08:20
laurit
approved these changes
May 5, 2021
| Runnable newTask = RunnableWrapper.wrapIfNeeded(task); | ||
| if (ExecutorInstrumentationUtils.shouldAttachStateToTask(newTask)) { | ||
| if (ExecutorInstrumentationUtils.shouldAttachStateToTask(task)) { | ||
| Runnable newTask = RunnableWrapper.wrapIfNeeded(task); |
Contributor
There was a problem hiding this comment.
Could drop newTask and just assign to task.
trask
approved these changes
May 5, 2021
Comment on lines
+27
to
+29
| // Must use context from channel, as executor instrumentation is not accurate - Ratpack | ||
| // internally queues events and then drains them in batches, causing executor instrumentation to | ||
| // attach the same context to a batch of events from different requests. |
Comment on lines
+96
to
+100
| // Context is passed through Netty channels in Ratpack as executor instrumentation is | ||
| // not suitable. As the context that would be propagated via executor would be | ||
| // incorrect, skip the propagation. Not checking for concrete class names as this covers | ||
| // anonymous classes from ratpack.exec.internal.DefaultExecution and | ||
| // ratpack.exec.internal.DefaultExecController. |
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.
Fixes #2648
ratpack.handleras executor instrumentation does not work correctly for it.