Hi all,
I would like to ask the community for help with an issue we are experiencing running the
Long Running Action module of Narayana in WildFly. Going straight to the point, we are
experiencing a funny issue when a thread from ForkJoin pool is used to manage expired LRA
transactions: in the `try/catch` block at [1], the following exception is thrown:
```javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request:
javax.ws.rs.ProcessingException: RESTEASY003215: could not find writer for content-type
text/plain type: java.lang.String```
We arrive at that `try/catch` block from this async call [2]. It seems that the request
from the coordinator to the participant [3] fails because there is no provider for
"content-type text/plain type: java.lang.String" (which sounds strange as this
should be one of the basic providers).
We see this exception when the Narayana LRA WAR is deployed to WildFly and also when the
LRA coordinator is provided as a feature pack. Also, the same exception is thrown when the
TransactionReaper thread (a standard Thread implementing Runnable) is employed to handle
expired LRA transactions (we would prefer to use TransactionReaper since we also employ it
in the JTA module to manage transaction timeouts).
We know that the best practise would be to use a managed thread pool but we want to keep
Narayana LRA independent from any container.
To temporarily overcome this issue, we used a dedicated ThreadPool
```private static final BlockingQueue<Runnable> queue = new
ArrayBlockingQueue<>(100);
private static final ExecutorService EXECUTOR_SERVICE = new ThreadPoolExecutor(10, 10, 0L,
TimeUnit.MICROSECONDS, queue);```
in [2], i.e.
```CompletableFuture.supplyAsync(this::cancelLRA, EXECUTOR_SERVICE);```
This fixes the issue...but to us it looks more like a workaround rather than a solution.
This workaround is going to be merged (again) in our current main branch (PR 1907 [4]).
Some extra info about this issue:
* Narayana uses RESTEasy 3.9.1
* I have tried to use RESTEasy 4.7.1 but with no luck
* According with James (hopefully, I have reported this well), ResteasyContext map is
empty and the reason does not seem to be related to the use of a non-managed thread
[1]:
https://github.com/jbosstm/narayana/blob/44cb48e1d4d93045a138f182153cce6e...
[2]:
https://github.com/jbosstm/narayana/blob/44cb48e1d4d93045a138f182153cce6e...
[3]:
https://github.com/jbosstm/narayana/blob/44cb48e1d4d93045a138f182153cce6e...
[4]:
https://github.com/jbosstm/narayana/pull/1907