-
Notifications
You must be signed in to change notification settings - Fork 128
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
Return 400 on failed training request #168
Conversation
Signed-off-by: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #168 +/- ##
============================================
- Coverage 82.66% 82.57% -0.10%
Complexity 803 803
============================================
Files 117 117
Lines 3582 3586 +4
Branches 338 338
============================================
Hits 2961 2961
- Misses 466 470 +4
Partials 155 155
Continue to review full report at Codecov.
|
@@ -82,7 +83,9 @@ public void execute(TrainingJob trainingJob, ActionListener<IndexResponse> liste | |||
// the number of training jobs that enter this function. Although the training threadpool size will also prevent | |||
// this, we want to prevent this before we perform any serialization. | |||
if (!semaphore.tryAcquire()) { | |||
throw new RejectedExecutionException("Unable to run training job: No training capacity on node."); | |||
ValidationException exception = new ValidationException(); | |||
exception.addValidationError("Unable to run training job: No training capacity on node."); |
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 it possible to print node name?
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.
No, that information is not readily available.
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.
Should we log the error as log.info
?
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.
LGTM! Thanks
Signed-off-by: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]> Signed-off-by: Martin Gaievski <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Description
PR changes validation logic to throw 400 error codes as opposed to 500 errors codes during training.
In RestTrainModelHandler, change parser.text to parser.textOrNull to allow a user to pass in a null string argument. Validation is then done later.
In training request execution, throw a validation exception if there is no training capacity. This results in a 400 error being returned
Check List
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.