Skip to content

Commit 002036e

Browse files
doxiaoddsharpe
authored andcommitted
OWLS109199 part 2 - Continue domain processing when spec changed even if there are retriable failures
1 parent 8996076 commit 002036e

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

operator/src/main/java/oracle/kubernetes/operator/DomainProcessorImpl.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ private boolean shouldContinue(MakeRightDomainOperation operation, DomainPresenc
389389
return false;
390390
} else if (isDeleting(operation)) {
391391
return true;
392-
} else if (liveInfo.isDomainProcessingHalted(cachedInfo)
393-
|| hasRetriableFailureNonRetryingOperation(operation, liveInfo)) {
392+
} else if (liveInfo.isDomainProcessingHalted(cachedInfo)) {
394393
return false;
395-
} else if (operation.isExplicitRecheck() || liveInfo.isDomainGenerationChanged(cachedInfo)) {
394+
} else if (isExplicitRecheckWithoutRetriableFailure(operation, liveInfo)
395+
|| liveInfo.isDomainGenerationChanged(cachedInfo)) {
396396
return true;
397397
} else {
398398
cachedInfo.setDomain(liveInfo.getDomain());
@@ -415,6 +415,11 @@ private boolean shouldContinue(MakeRightClusterOperation operation, ClusterPrese
415415
return false;
416416
}
417417
}
418+
419+
private boolean isExplicitRecheckWithoutRetriableFailure(
420+
MakeRightDomainOperation operation, DomainPresenceInfo info) {
421+
return operation.isExplicitRecheck() && !hasRetriableFailureNonRetryingOperation(operation, info);
422+
}
418423

419424
private boolean hasRetriableFailureNonRetryingOperation(MakeRightDomainOperation operation, DomainPresenceInfo info) {
420425
return info.hasRetriableFailure() && !operation.isRetryOnFailure();

operator/src/test/java/oracle/kubernetes/operator/DomainProcessorTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ void whenDomainChangedSpecWithForDeletion_dontGenerateDomainChangedEvent() {
424424
}
425425

426426
@Test
427-
void whenDomainWithRetriableFailureButNotRetrying_dontContinueProcessing() {
427+
void whenDomainSpecNotChangedWithRetriableFailureButNotRetrying_dontContinueProcessing() {
428428
originalInfo.setPopulated(true);
429429
processor.registerDomainPresenceInfo(originalInfo);
430430
domain.getStatus().addCondition(new DomainCondition(FAILED).withReason(DOMAIN_INVALID));
@@ -434,6 +434,17 @@ void whenDomainWithRetriableFailureButNotRetrying_dontContinueProcessing() {
434434
assertThat(logRecords, containsFine(NOT_STARTING_DOMAINUID_THREAD));
435435
}
436436

437+
@Test
438+
void whenDomainSpecChangedWithRetriableFailureButNotRetrying_continueProcessing() {
439+
originalInfo.setPopulated(true);
440+
processor.registerDomainPresenceInfo(originalInfo);
441+
domain.getStatus().addCondition(new DomainCondition(FAILED).withReason(DOMAIN_INVALID));
442+
443+
processor.createMakeRightOperation(newInfo).withExplicitRecheck().execute();
444+
445+
assertThat(logRecords, not(containsFine(NOT_STARTING_DOMAINUID_THREAD)));
446+
}
447+
437448
@Test
438449
void whenDomainWithRetriableFailureButForDeletion_continueProcessing() {
439450
originalInfo.setPopulated(true);

0 commit comments

Comments
 (0)