79754375

Date: 2025-09-03 09:09:50
Score: 0.5
Natty:
Report link

We figure out how to get around this, we don't know if there would be alternatives but we are satisfied with the existing one so we will not pursue any further investigation for now.

So if anyone runs into this thread at some point and has the same issue here's how we got around it.

We created a wrapper for managing context:

@ApplicationScoped
public class ArcContextWrapper {

    public ManagedContext getRequestContext() {
        return Arc.container().requestContext();
    }

}

Then we introduced this in the method we figured out was causing the issue

ManagedContext ctx = arcContextWrapper.getRequestContext();
ctx.activate();

This method had a lot of reactive calls in chain that used multiple threads, which was causing it to get lost.
To ensure this works properly we added this at the end of the chain (that starts with deferred)

.eventually(ctx::terminate)

That exception I reported no longer happens after this change and the app is behaving normally.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user31394879