-
Bug
-
Resolution: Done
-
Major
-
4.4.0.Final
-
None
-
None
I see this kind of thread hanging around + my "app" doesn't exit:
It's due to "this.cleanupExecutor = cleanupExecutor;" being set to false ...
See see org.jboss.resteasy.microprofile.client.RestClientBuilderImpl#238
public ResteasyClientBuilder executorService(ExecutorService executorService) { return asyncExecutor(executorService, false); //... // this is rest easy default ExecutorService executorService = this.executorService != null ? this.executorService : Executors.newFixedThreadPool(10); ExecutorService executor = AsyncInvocationInterceptorHandler.wrapExecutorService(executorService); resteasyClientBuilder.executorService(executor);
As we can see new executorService is created, added as asyncExecutor, but with cleanupExecutor==false.
Hence the executor is never shutdown in client's close().
If I use and control own executor, it all works (exists) as expected.
I use some CompletionStage as return type in my app's REST API, which uses this executor – hence "leaking" the thread.
If no async REST API is actually used, it's all fine – probably why this didn't show-up before.