Dynamic thread pool exiting after maxInactiveTime for long running jobs
See original GitHub issueI have a job running for more than one minute (it involves some API calls). The issue is that after one minute (default maxInactiveTime), the worker will close itself whether the job is running or not. I think the code should include a check for whether the job is running or not in function _checkAlive
.
Please share your thoughts on this.
As a workaround for now, I can either move to Fixed thread pool or use a high value for maxInactiveTime.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Dynamic resizing of java.util.concurrent.ThreadPoolExecutor ...
If you are trimming the pool size, the remaining threads will shut-down once their current job queue is completed (if they are idle, ......
Read more >Introduction to Thread Pools in Java - Baeldung
Quick and practical guide to different ThreadPool implementations in Java and Guava.
Read more >poolifier/poolifier: Fast and small Node.js thread pool ... - GitHub
maxInactiveTime - Max time to wait tasks to work on (in ms), after this period the new worker will die. The last active...
Read more >Finally Getting the Most out of the Java Thread Pool - Stackify
Essentially, threads are kept in the thread pool until they're needed, after which they execute the task and return the pool to be...
Read more >ThreadPoolExecutor in Python: The Complete Guide
If we forget to close the pool and there are still tasks executing, the main thread will not exit until all tasks in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the quick reply, I need a quick solution, so I will go with high value for maxInactiveTime for now. I will surely look into contributing in my free time.
@jithinsk FYI we released a 2.0.0.beta version that you can now use. We will release the 2.0.0 stable version around next week. Enjoy 😃