question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shut down ForkJoinPool in KMeansTrainer

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Craigacpcommented, May 6, 2022
1reaction
Craigacpcommented, Apr 28, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found