Shut down ForkJoinPool in KMeansTrainer
See original GitHub issueDescribe the bug
KMeansTrainer
will create ForkJoinPool to train KMeans model in parallel, code link : https://github.com/oracle/tribuo/blob/main/Clustering/KMeans/src/main/java/org/tribuo/clustering/kmeans/KMeansTrainer.java#L284-L293
But the ForkJoinPool doesn’t shutdown when training complete. As KMeansTrainer
doesn’t set keepAliveTime
for ForkJoinPool, the default keep alive time is 60 seconds. Refer to https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/ForkJoinPool.html
keepAliveTime - the elapsed time since last use before a thread is terminated (and then later replaced if needed). For the default value, use 60, TimeUnit.SECONDS.
It’s risky when kmeans training requests come in high volume in short time (<60seconds).
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
ForkJoinPool::shutdown vs ForkJoinPool::shutdownNow after ...
Generally: shutdown(); implies you are doing clean / ordered shutdown for the executor service, and shutdownNow(); used for particular ...
Read more >Java Forkjoinpool shutdown() Method with Examples
The shutdown() method of ForkJoinPool class initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be ......
Read more >ForkJoin Pool Behaviour when not ShutDown - LinkedIn
Recently I debugged an issue in production. It allowed me to go through ForkJoinPool behaviour. I am sharing my finding here.
Read more >ForkJoinPool (Java Platform SE 8 ) - Oracle Help Center
Returns true if all worker threads are currently idle. boolean, isShutdown(). Returns true if this pool has been shut down.
Read more >documentation on ForkJoinPool should mention shutdown()
The threads in the ForkJoinPool are not released unless you call some flavor of shutdown().
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
Tribuo 4.2.1 is now on Maven Central - https://search.maven.org/artifact/org.tribuo/tribuo-all/4.2.1/pom.
OLCUT 5.2.1 has been tagged however last week we started rolling out a new internal process for pushing libraries to Maven Central for open source projects and so our releases got caught up in that. I’ve made the request, and I’m hopeful it will happen soon. Once it does I’ll bump the version in Tribuo, merge that to the
v4.2.X-release-branch
, tag the new version and request that is pushed to Maven Central.Once the bugs are worked out in the new release process it should be faster and I’ll have more understanding of when binaries will make it to Maven Central (so can plan these things better), but we’re one of the first projects to go through the new process so there are inevitable issues.