Skip to content

HttpRequest#executeAsync() may throw a RejectedExecutionException #372

@sotodel

Description

@sotodel

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.

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.priority: p2Moderately-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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions