Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpRequest#executeAsync() may throw a RejectedExecutionException #372

Closed
sotodel opened this issue Sep 27, 2017 · 0 comments
Closed

HttpRequest#executeAsync() may throw a RejectedExecutionException #372

sotodel opened this issue Sep 27, 2017 · 0 comments
Assignees
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.

Comments

@sotodel
Copy link

sotodel commented Sep 27, 2017

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.

@mattwhisenhunt mattwhisenhunt added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 8, 2018
@JustinBeckwith JustinBeckwith added the 🚨 This issue needs some love. label Jun 8, 2018
clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

4 participants