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

Default threadpool uses unbounded queue #67

Open
kapilreddy opened this issue Feb 14, 2023 · 2 comments
Open

Default threadpool uses unbounded queue #67

kapilreddy opened this issue Feb 14, 2023 · 2 comments

Comments

@kapilreddy
Copy link

com.climate.claypoole/threadpool creates an instance of ScheduledThreadPoolExecutor

It uses an unbounded queue which leads a silent accrue leading to exhaustion of resources.

Also we don't get finer control over what should be done when pool and queue are exhausted.

Proposed solution,

  • Use java.util.concurrent.ThreadPoolExecutor
  • Provide API for,
    ** queue size
    ** Selecting different policies. ie AbortPolicy, CallerRunsPolicy
@leon-barrett
Copy link
Contributor

The design permits you to create a threadpool of your own choice and use that. Does that meet your need here?

@kapilreddy
Copy link
Author

Yup, I love that I can create a thread pool of my choice, and it just works.

I was thinking of the library defaults. If that's something you don't think shouldn't change, we can add an example and a section in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants