Skip to content

Commit

Permalink
Return clearer errors for multiple-jobs validation.
Browse files Browse the repository at this point in the history
Signed-off-by: Rich Scott <[email protected]>
  • Loading branch information
richscott committed Oct 24, 2023
1 parent fe098e2 commit f1abe37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/armada/server/job_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func validateJobsCanBeScheduled(
if err != nil {
response := &api.JobSubmitResponseItem{
JobId: job.Id,
Error: errors.WithMessagef(err, "%d-th job can't be scheduled", i).Error(),
Error: fmt.Sprintf("%d-th job can't be scheduled: %v", i, err),
}
responseItems = append(responseItems, response)
} else {
Expand Down
4 changes: 2 additions & 2 deletions internal/armada/server/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,9 @@ func (q *AggregatedQueueServer) addAvoidNodeAffinity(
changed := addAvoidNodeAffinity(jobs[0], labels, func(jobsToValidate []*api.Job) error {
if ok, responseItems, err := validateJobsCanBeScheduled(jobsToValidate, allClusterSchedulingInfo); !ok {
if err != nil {
return errors.WithMessagef(err, "can't schedule %d job(s)", len(responseItems))
return errors.WithMessagef(err, "can't schedule %d (out of %d submitted) job(s)", len(responseItems), len(jobsToValidate))
} else {
return errors.Errorf("can't schedule %d job(s)", len(responseItems))
return errors.Errorf("can't schedule %d (out of %d submitted) job(s)", len(responseItems), len(jobsToValidate))
}
}
return nil
Expand Down

0 comments on commit f1abe37

Please sign in to comment.