-
Notifications
You must be signed in to change notification settings - Fork 162
[Agent] PlanExecuteReflect: Return memory early to track progress #3884
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
base: main
Are you sure you want to change the base?
[Agent] PlanExecuteReflect: Return memory early to track progress #3884
Conversation
@@ -0,0 +1,59 @@ | |||
package org.opensearch.ml.common.utils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add license header
public static final ImmutableSet<MLTaskState> TASK_DONE_STATES = ImmutableSet | ||
.of(MLTaskState.COMPLETED, MLTaskState.COMPLETED_WITH_ERROR, MLTaskState.FAILED, MLTaskState.CANCELLED); | ||
|
||
public static void updateMLTaskDirectly( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this method here from MLAgentExecutor to facilitate reuse
Signed-off-by: Pavan Yekbote <[email protected]>
Signed-off-by: Pavan Yekbote <[email protected]>
Signed-off-by: Pavan Yekbote <[email protected]>
a1de599
to
bae6369
Compare
} | ||
} catch (Exception e) { | ||
log.error("Failed to update ML task {}", taskId, e); | ||
listener.onFailure(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add the "Failed to update ML task {}", taskId in the onFailure message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onFailure accepts an exception. So do you want me to wrap the thrown exception with the message:
listener.onFailure(new Exception(String.format("Failed to update ML Task: %s, taskId), e)));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, use a new MLException please
ml-commons/common/src/main/java/org/opensearch/ml/common/exception/MLException.java
Line 11 in ac35832
public class MLException extends RuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this 5XX or 4XX level error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This try-catch is redundant, I have removed it. The only try-catch now is try-with-resources for the ThreadContext and I guess this should be 4XX errors.
ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLAgentExecutor.java
Show resolved
Hide resolved
please add UT to verify your change is expected |
The current test failure is added in this PR: #3882 |
Signed-off-by: Pavan Yekbote <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3884 +/- ##
============================================
- Coverage 78.84% 78.79% -0.05%
Complexity 7452 7452
============================================
Files 658 659 +1
Lines 33280 33299 +19
Branches 3750 3754 +4
============================================
- Hits 26240 26239 -1
- Misses 5393 5411 +18
- Partials 1647 1649 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
+1 |
Description
Related Issues
Resolves #3881
Check List
--signoff
.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.