Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PAYARA-2924 NPE on JAX-RS Async-Server EE7 Sample #3041
If request tracing is turned on when running this sample, a NPE is thrown.
This PR fixes this by saving the span context as an attribute of the InvocationContext object created by managed pools so that the span context can be propagated when setting up the thread context.
Threads from managed pools created external to Payara will not be traced however, such as those created by Jersey to handle timeouts.
This also adds the ability for OpenTracing to create traces itself (rather than requiring a trace to already be running), and includes a couple bits of cleanup.
Have you tested with versioned applications? I think you will get a clash.
I went with using this method as it's essentially how they suggest you do it in OpenTracing.
I'm not sure where I'd be getting a clash though, as the application name is only ever used for getting the Tracer instance, which is thread local anyway.