HttpRequest#executeAsync() may throw a RejectedExecutionException #372
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
🚨
This issue needs some love.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
As described in the question and answer in this Stack Overflow post and this JDK issue, the
ExecutorService
returned byExecutors.newSingleThreadExecutor
can be finalized and shut down while still in use.This may cause a
RejectedExecutionException
to be thrown whileHttpRequest#executeAsync(Executor)
is submitting its task.I suggest changing
HttpRequest#executeAsync()
to use anExecutorService
returned byExecutors#newFixedThreadPool(1)
, which isn't wrapped in aFinalizableDelegatingExecutorService
.The text was updated successfully, but these errors were encountered: