Skip to content
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

should request context be force-activated for @Asynchronous methods if context propagation is used? #352

Open
Ladicek opened this issue Jan 12, 2021 · 1 comment

Comments

@Ladicek
Copy link
Contributor

Ladicek commented Jan 12, 2021

When MicroProfile Context Propagation integration is not enabled, SmallRye Fault Tolerance obeys the MicroProfile Fault Tolerance specification and always activates the CDI request context for @Asynchronous method invocations.

However, when MicroProfile Context Propagation integration is enabled, we leave everything to Context Propagation. This means that if the request context is not active on the original thread, it isn't active during the @Asynchronous method invocation either. This is contrary to the spec, but makes more sense from the Context Propagation perspective.

I have implemented a fix that enforces request context activation even in presence of Context Propagation integration, but I'm not sure if that's correct. I tend to think that the current behavior is more appropriate, but we can debate it here.

(Note that in Quarkus, SmallRye Fault Tolerance always has the Context Propagation integration enabled.)

@Ladicek Ladicek changed the title should request context be activated if not active and context propagation is used? should request context be force-activated for @Asynchronous methods if context propagation is used? Jan 12, 2021
@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 12, 2021

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

No branches or pull requests

1 participant