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

code refactor not to occur nullpointer exception #2816

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

dhrubo-os
Copy link
Collaborator

Description

[Without this change following error can happen:

java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because "doesVersionCreateModelGroup" is null
	at org.opensearch.ml.model.MLModelManager.deleteOrUpdateModelGroup(MLModelManager.java:960) ~[?:?]
	at org.opensearch.ml.model.MLModelManager.deleteModel(MLModelManager.java:953) ~[?:?]
	at org.opensearch.ml.model.MLModelManager.lambda$registerModel$34(MLModelManager.java:858) [opensearch-ml-multi-tenancy-2.15.0-SNAPSHOT.jar:multi-tenancy-2.15.0-SNAPSHOT]
	at org.opensearch.core.action.ActionListener$1.onFailure(ActionListener.java:90) [opensearch-core-2.15.0.jar:2.15.0]
	at org.opensearch.ml.engine.ModelHelper.downloadAndSplit(ModelHelper.java:297) ~[?:?]
	at org.opensearch.ml.model.MLModelManager.registerModel(MLModelManager.java:774) ~[?:?]
	at org.opensearch.ml.model.MLModelManager.lambda$registerModelFromUrl$27(MLModelManager.java:749) ~[?:?]
	at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) [opensearch-core-2.15.0.jar:2.15.0]
	at org.opensearch.action.support.ThreadedActionListener$1.doRun(ThreadedActionListener.java:78) [opensearch-2.15.0.jar:2.15.0]
	at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:941) [opensearch-2.15.0.jar:2.15.0]
	at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) [opensearch-2.15.0.jar:2.15.0]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [?:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
	```
]

### Related Issues
Resolves #[Issue number to be closed when this PR is merged]
<!-- List any other related issues here -->

### Check List
- [ ] New functionality includes testing.
- [ ] New functionality has been documented.
- [ ] API changes companion pull request [created](https://github.com/opensearch-project/opensearch-api-specification/blob/main/DEVELOPER_GUIDE.md).
- [ ] Commits are signed per the DCO using `--signoff`.
- [ ] Public documentation issue/PR [created](https://github.com/opensearch-project/documentation-website/issues/new/choose).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/ml-commons/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

@dhrubo-os dhrubo-os temporarily deployed to ml-commons-cicd-env August 8, 2024 23:38 — with GitHub Actions Inactive
@dhrubo-os dhrubo-os merged commit a4dff63 into opensearch-project:main Aug 9, 2024
7 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 9, 2024
Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit a4dff63)
dhrubo-os added a commit that referenced this pull request Aug 9, 2024
Signed-off-by: Dhrubo Saha <[email protected]>
(cherry picked from commit a4dff63)

Co-authored-by: Dhrubo Saha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants