Skip to content

Conversation

tylerbenson
Copy link
Contributor

This helps to ensure the current span when the callback is registered is accessible when the callback executes.

@tylerbenson tylerbenson requested a review from a team as a code owner July 10, 2020 01:13
@richardstartin
Copy link
Contributor

Can you explain how this helps to ensure that the current span when the callback is registered is accessible when the callback executes, as if to a five year old?

@tylerbenson
Copy link
Contributor Author

This follows the same principle as our regular executor instrumentation. When a runnable is added as a listener, we capture the current context (span) and attach it to the runnable. Later, when the runnable is executed, it finds that context and restores it into the current thread, which is potentially different from the original thread.

This helps to ensure the current span when the callback is registered is accessible when the callback executes.
It works in Idea, but not gradle.  I think there's a problem with classloading order but I'm not sure why.
@tylerbenson tylerbenson merged commit e61d5bf into master Jul 14, 2020
@tylerbenson tylerbenson deleted the tyler/guava branch July 14, 2020 14:45
@github-actions github-actions bot added this to the 0.58.0 milestone Jul 14, 2020
@tylerbenson tylerbenson mentioned this pull request Jul 14, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants