-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: ActiveSpanHolder demo diff #4
Conversation
private final ThreadLocal<MDCContinuation> tlsSnapshot = new ThreadLocal<MDCContinuation>(); | ||
|
||
class MDCContinuation extends Continuation { | ||
private final Map<String, String> mdcContext; |
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.
The mdcContext
is never read from.
What is your intention of getting the copy?
I have issues with propagating an entire MDC from thread to thread, since there is no knowing which entries are actually 'functionally' transferable and which aren't.
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.
@sjoerdtalsma this was just a bug introduced by a rebase or something... I am now setting the MDC context during activate(), and also added a "test" (sic) to the MDCDemo.java which works as intended. Good catch, though!
What if some MDC keys are actually meant for the parent thread and not to be propagated? |
The stated purpose of MDC is to propagate along with the transaction, so IMO that's not a concern... I suppose if such support were needed, though, an |
Also, have ActiveSpan inherit from Span. Deal with fallout.
... via an MDC implementation.
This is just a demo showing how
ActiveSpanHolder
can be implemented on top of MDC.