-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Ratpack server context propagation and enable its concurrency test #2910
Fix Ratpack server context propagation and enable its concurrency test #2910
Conversation
Runnable newTask = RunnableWrapper.wrapIfNeeded(task); | ||
if (ExecutorInstrumentationUtils.shouldAttachStateToTask(newTask)) { | ||
if (ExecutorInstrumentationUtils.shouldAttachStateToTask(task)) { | ||
Runnable newTask = RunnableWrapper.wrapIfNeeded(task); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could drop newTask
and just assign to task
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #2648
ratpack.handler
as executor instrumentation does not work correctly for it.