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

fix studyJob status suggestionCount mismatch error #290

Merged
merged 1 commit into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/controller/studyjob/katib_api_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func initializeStudy(instance *katibv1alpha1.StudyJob, ns string) error {
return err
}
instance.Status.SuggestionParameterID = sPID
instance.Status.SuggestionCount += 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SuggestionCount should record how many times the studyJob had called suggestion, and this value should += 1 every time after calling suggestion.
Here (initialize studyJob instance and no suggestion called before) instance.Status.SuggestionCount should be 0 (0 by default).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YujiOshima Is this the intended behavior? Should we update the API documentation instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, SuggestionParam["SuggestionCount"] in db change path is [0, 2, 3, ..., requestcount+1].
after this patch its path is [0,1,2,...,requestcount]

Copy link
Contributor

@YujiOshima YujiOshima Dec 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hougangliu Thanks.

SuggestionParam["SuggestionCount"] in db change path is [0, 2, 3, ..., requestcount+1].

This is not intended behavior, we may need to fix. I'm reviewing and testing this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

instance.Status.Condition = katibv1alpha1.ConditionRunning
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/studyjob/studyjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (r *ReconcileStudyJobController) checkStatus(instance *katibv1alpha1.StudyJ
}
}
if nextSuggestionSchedule {
if instance.Spec.RequestCount > 0 && instance.Status.SuggestionCount > instance.Spec.RequestCount {
if instance.Spec.RequestCount > 0 && instance.Status.SuggestionCount >= instance.Spec.RequestCount {
log.Printf("Study %s reached the request count. It is completed", instance.Status.StudyID)
instance.Status.Condition = katibv1alpha1.ConditionCompleted
now := metav1.Now()
Expand Down