-
Notifications
You must be signed in to change notification settings - Fork 64
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
Context propagation #326
Comments
Cross-linking issue with mp-ot microprofile/microprofile-opentracing#108 |
@pavolloffay we are fully aware of this, which leads to the specification of microprofile concurrency. We plan to do minimal in this spec for context propagation but rely on concurrency spec to fix the propagation issues. |
@Emily-Jiang thanks for the response. I could not find any references in FT repo on this feature. It would be good to create an issue there for people to subscribe. Do you know what is the timeline for this to land in concurrency? |
MP Concurrency aims for MP 2.2 release. |
We need to revisit the discussion on whether and when to add MP Context Propagation to the MP umbrella release so that FT can integrate with Context Propagation. |
Possible design:
This would require the Fault Tolerance implementation to create a |
One interesting thing is that Not sure why is that. CC @manovotn |
We might require certain contexts to be propagated or cleared by default (either matching the default in the context propagation spec, which also allows it to be configured, or matching the current behaviour required by Fault Tolerance.) We could test this both with the built-in contexts (e.g. check that the CDI If we test using the built-in contexts, we'd need to check what is actually verified by the context propagation TCK. |
Good question @Ladicek. Frankly, I am not sure, it probably has something to do with |
It also seems that there used to be a notion of "default contexts that are propagated/cleared", eclipse/microprofile-context-propagation#27, but that somehow disappeared. I don't know the details, but it seems unfortunate. |
@Ladicek the spec did not define the default set of contexts to propagate because we weren't able to reach a consensus on what the default set ought to be (specifically, whether to include transaction context). So the defaults are currently vendor-specific, but a future update to the spec could clarify. Regarding,
the above is due to a difference in usage patterns. ManagedExecutor supplies threads (typically from a pool) on which to run async requests, in which case the concept of having a pre-existing context on the thread that you would want to leave |
Thanks @njr-11, this is very useful. I propose, for FT purposes, to:
|
@njr-11 thanks for refreshing memory on that. @Ladicek the other tricky part is the contexts you don't specify explicitly even is you list some in
|
I think we want to stay consistent with ConProp as much as possible, including when it comes to |
What do you mean by saying ConProp @Ladicek ? In Fault Tolerance spec, the spec already said the security context and application context are propagated. In Context Propagation, it is ok not to specify default as it does not know the scenario where in Fault Tolerance we have all of the information. I also think by default propagating CDI Context is expected. Another reason for Context Propagation not to specify default is due to the different opinions on Transaction context. |
I use "ConProp" to mean "Context Propagation", because it's faster to write :-) Unfortunately, the term has multiple meanings. One, as you mention, is that in Jakarta EE environment, we specify that the naming and security contexts should be propagated. Another is MicroProfile Context Propagation -- a completely different thing. We currently don't integrate with that at all. This issue is about MP ConProp -- the "naming and security contexts are propagated" are a different thing. Integrating MP ConProp could subsume that, under certain circumstances. (MP ConProp would have to have a "naming" context defined, perhaps as part of the |
@Ladicek thanks. I am not good at guess the acronyms :o. Prop always translates to properties for me. Maybe I am too close to MP Config.
|
That sounds nice, but isn't what the MP ConProp spec says, nor what its TCK tests. Specifically, the spec says that "it can determine the thread context class loader as well as the set of resource references that are available for lookup or resource injection", which is quite vague. The TCK test for the
We can do that, but then we can't rely on it for propagating the naming and security contexts and probably need to keep the Jakarta EE-specific part of the spec. |
I raised the following issue for MP Context Propagation to fix eclipse/microprofile-context-propagation#192
Agreed. |
The general language describing Application context and other context types is the unfortunate consequence of trying to write a spec that can be implemented by application servers as well as other containers/implementations which are not. Originally, the wording was more application server-specific and could mention things like java:comp and JNDI, but we had to make it more general to accommodate other implementations. |
I thought about this further and come up with the following proposal:
|
I have submitted an initial specification text proposal: #565. Comments welcome. |
Support integration with context propagation The integration is optional. Not portable. Disadvantages: |
Hi folks,
@Asynchronous
annotation and maybe others execute the method on a different thread which breaks context propagated via thread locals. If these methods use mp-rest-client it breaks tracing or e.g. MDC.On the spec level there could be a way to reliably propagate context between threads. It could be done by providing custom executor service or maybe via https://github.com/eclipse/microprofile-concurrency
The text was updated successfully, but these errors were encountered: