-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
🚨This issue needs some love.This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
As described in the question and answer in this Stack Overflow post and this JDK issue, the ExecutorService returned by Executors.newSingleThreadExecutor can be finalized and shut down while still in use.
This may cause a RejectedExecutionException to be thrown while HttpRequest#executeAsync(Executor) is submitting its task.
I suggest changing HttpRequest#executeAsync() to use an ExecutorService returned by Executors#newFixedThreadPool(1), which isn't wrapped in a FinalizableDelegatingExecutorService.
zhengl7
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.