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

Shut down ForkJoinPool in KMeansTrainer #223

Closed
ylwu-amzn opened this issue Mar 16, 2022 · 11 comments
Closed

Shut down ForkJoinPool in KMeansTrainer #223

ylwu-amzn opened this issue Mar 16, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@ylwu-amzn
Copy link

ylwu-amzn commented Mar 16, 2022

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).

@ylwu-amzn ylwu-amzn added the bug Something isn't working label Mar 16, 2022
@ylwu-amzn
Copy link
Author

Close this issue as PR #224 merged

@ylwu-amzn ylwu-amzn reopened this Mar 25, 2022
@ylwu-amzn
Copy link
Author

We plan to release a new version of OpenSearch/ml-commons soon, maybe in next 2 weeks. Is it possible you release 4.2.1 including this fix quckly?

@Craigacp
Copy link
Member

I expect we can get it tagged in the repo next week, however I'm not in control of the push to Maven Central so I don't know if that will happen within two weeks.

@ylwu-amzn
Copy link
Author

Thanks, I see you add release note for 4.2.1 , 2338b10, hope that can be released soon.

@Craigacp
Copy link
Member

Craigacp commented Mar 30, 2022

Yeah, it'll take a little while longer unfortunately as I need to tag OLCUT with a bumped version of jackson, push that to Maven Central and then have Tribuo depend on that (both in main and v4.2.X-release-branch).

@ylwu-amzn
Copy link
Author

@Craigacp any update on the new version release for 4.2.1?

@Craigacp
Copy link
Member

Working on it. Should have OLCUT tagged by the end of the week, then I can work on Tribuo.

@ylwu-amzn
Copy link
Author

Sorry to ask again, any progress for 4.2.1 release?

@Craigacp
Copy link
Member

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.

@ylwu-amzn
Copy link
Author

Totally understand. Thanks a lot @Craigacp !

@Craigacp
Copy link
Member

Craigacp commented May 6, 2022

Tribuo 4.2.1 is now on Maven Central - https://search.maven.org/artifact/org.tribuo/tribuo-all/4.2.1/pom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants