-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ArCContextProvider does not propagate request context #3186
Comments
This won't really work because CDI doesn't know when the request is truly over. The propagation is done in a way that the next task activates request scope (with no link to actual original HTTP request) and once done it tears it deactivates the context but deliberately doesn't destroy is hence If the predestroy callback execute:
Furthermore, in parallel scenario you don't really know which propagation step (which thread) is 'eligible' to say "Hey, this is where the request ends!" even if you had the 'shared map' situation. I've planned a call with @mkouba to discuss possible solutions in Arc. |
Well, I've switched to an implementation that copies the mutable |
It's destroyed in |
Though I see now it destroys a copy of the request state and not the entire request, so the same problem can happen. I'm not sure why it works in my test then. |
But it's easily fixable as well. |
For the record, this is the bit in Undertow what needs changing as well - https://github.com/quarkusio/quarkus/blob/master/extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/UndertowDeploymentRecorder.java#L489 |
A draft of what me and Martin came up with is here - #3243 |
Thanks! |
As explained on Zulip and eclipse/microprofile-context-propagation#167, the current ArcContextProvider does not allow propagation of the request context, because it captures/restores values instead of the entire context.
We need to fix this because ATM it can't be used by reactive applications, which is the whole point of MP-CP.
Reproducer:
Then make two REST calls to
/datatypes
then/datatypes-destroyed
and observe that we create more than one request bean per request, and destroy a total of zero of them.The text was updated successfully, but these errors were encountered: