Closed qwtsc closed 9 months ago
It seems Enum already overrides write toString
maybe we need to implement DefaultJobState.toString()
?
maybe we need to implement
DefaultJobState.toString()
?
Done, and I have found the issue that blocked the minikube test. please review the latest changed files.
Attention: 10 lines
in your changes are missing coverage. Please review.
Comparison is base (
ff85e34
) 85.03% compared to head (1133673
) 85.07%. Report is 3 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
thanks and could give more context about the issue/bug?
it may be this issue: https://github.com/apache/incubator-hugegraph-computer/pull/287#discussion_r1403393492
I still can't find the root cause. Let's keep this PR open for another two or three days. If it's still mysterious to me, we can append it to PR #287.
@coderzc @javeme @imbajin I finally find the actual reason.
background
since v1.20. Plus the way you added finalizer is replaceCR
, so you will sometimes miss the delete event generated by your client.
private boolean finalizer(HugeGraphComputerJob computerJob) {
if (computerJob.addFinalizer(FINALIZER_NAME)) {
---> // this is partial reason, can u use patch CR instead?
this.replaceCR(computerJob);
return true;
}
ComputerJobStatus status = computerJob.getStatus();
if (computerJob.isMarkedForDeletion()) {
if (!JobStatus.finished(status.getJobStatus())) {
status.setJobStatus(JobStatus.CANCELLED.name());
this.updateStatus(computerJob);
} else {
if (computerJob.removeFinalizer(FINALIZER_NAME)) {
this.replaceCR(computerJob);
}
}
return true;
} else {
if (JobStatus.finished(status.getJobStatus())) {
if (this.autoDestroyPod) {
this.deleteCR(computerJob);
}
return true;
}
}
return false;
}
k8s will deleted its owned resource in the background whether the CR is deleted or not, so the calculated job status will always remain INITIALIZING, then the operator won't deploy again.
ComputerJobComponent observed = this.observeComponent(computerJob);
----> //calculated status remains INITIALIZING forever, so won't deploy it again.
if (!this.updateStatus(observed) && request.retryTimes() == 0) {
LOG.debug("Wait status to be stable before taking further actions");
return OperatorResult.NO_REQUEUE;
}
if (Objects.equals(computerJob.getStatus().getJobStatus(),
JobStatus.RUNNING.name())) {
String crName = computerJob.getMetadata().getName();
LOG.info("ComputerJob {} already running, no action", crName);
return OperatorResult.NO_REQUEUE;
}
ComputerJobDeployer deployer = new ComputerJobDeployer(this.kubeClient,
this.config);
deployer.deploy(observed);
return OperatorResult.NO_REQUEUE;
My solution is to adjust the delete policy back to foreground. Everyone is happy now.
BTW, the u could import the hugegraph-style.xml to avoid most of the align/import problems
Got it.
I cannot repeat your failure, but it failed with another reason. I am concerned with the quality of test cases.
@qwtsc Please correct the title of PR.
@qwtsc Please correct the title of PR.
done
Purpose of the PR
Main Changes
Verifying these changes
[ ] Need tests and can be verified as follows.
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO
Doc - Done
Doc - No Need