If you pass an AsyncContext to a random other thread (which is not necessarily container managed), then the fact that code in this other thread gets hold of this context, doesn't set up the TLS stuff needed for @RequestScoped etc, does it?
If so, how would this technically work?
This is different from container managed threads which get work submitted to it (like Concurrency spec executor service and @Asynchronous). They have an opportunity to set up and tear down the contexts before and after working on the unit respectively.
For the AsyncContext case, what about something like the following in the thread that in whatever way gets hold of the AsyncContext
beanmanager.initScope(RequestScoped.class, request);
or with a guard:
beanmanager.initScopeIfNotActive(RequestScoped.class, request);
Would that work?