Skip to content

Commit 865693a

Browse files
committed
Revert PR #28: Remove readiness checks and queuing that prevented pod failure detection
This reverts the changes from commit ee9169e which introduced system readiness checks that were blocking pod failure processing. The readiness checks were preventing the operator from detecting new pod failures because the system was not becoming ready due to strict dependency requirements.
1 parent 88c388c commit 865693a

File tree

3 files changed

+7
-384
lines changed

3 files changed

+7
-384
lines changed

src/main/java/com/redhat/podmortem/operator/health/PatternLibraryReadinessCheck.java

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.time.Instant;
1111
import java.time.temporal.ChronoUnit;
1212
import java.util.List;
13-
import org.eclipse.microprofile.config.inject.ConfigProperty;
1413
import org.eclipse.microprofile.health.HealthCheck;
1514
import org.eclipse.microprofile.health.HealthCheckResponse;
1615
import org.eclipse.microprofile.health.Readiness;
@@ -23,11 +22,7 @@
2322
public class PatternLibraryReadinessCheck implements HealthCheck {
2423

2524
private static final Logger log = LoggerFactory.getLogger(PatternLibraryReadinessCheck.class);
26-
private static final String DEFAULT_PATTERN_CACHE_DIR = "/shared/patterns";
27-
28-
@ConfigProperty(name = "pattern.cache.directory", defaultValue = DEFAULT_PATTERN_CACHE_DIR)
29-
String patternCacheDir;
30-
25+
private static final String PATTERN_CACHE_DIR = "/shared/patterns";
3126
private static final int MAX_WAIT_MINUTES = 5;
3227

3328
@Inject KubernetesClient client;
@@ -45,20 +40,7 @@ public HealthCheckResponse call() {
4540
return HealthCheckResponse.named("pattern-library-sync").up().build();
4641
}
4742

48-
boolean anyReady =
49-
libraries.stream()
50-
.anyMatch(
51-
lib ->
52-
lib.getStatus() != null
53-
&& "Ready"
54-
.equalsIgnoreCase(
55-
lib.getStatus().getPhase()));
56-
if (anyReady) {
57-
log.trace("At least one PatternLibrary reports Ready phase; marking ready");
58-
return HealthCheckResponse.named("pattern-library-sync").up().build();
59-
}
60-
61-
Path cacheDir = Paths.get(patternCacheDir);
43+
Path cacheDir = Paths.get(PATTERN_CACHE_DIR);
6244
if (!Files.exists(cacheDir)) {
6345
if (startupTime
6446
.plus(MAX_WAIT_MINUTES, ChronoUnit.MINUTES)
@@ -67,7 +49,7 @@ public HealthCheckResponse call() {
6749
"Pattern library sync grace period exceeded (no cache dir), reporting ready anyway");
6850
return HealthCheckResponse.named("pattern-library-sync").up().build();
6951
}
70-
log.debug("Pattern cache directory does not exist: {}", patternCacheDir);
52+
log.debug("Pattern cache directory does not exist: {}", PATTERN_CACHE_DIR);
7153
return HealthCheckResponse.named("pattern-library-sync").down().build();
7254
}
7355

src/main/java/com/redhat/podmortem/operator/service/LogParserClient.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ public Uni<AnalysisResult> analyzeLog(PodFailureData failureData) {
4646
"Received analysis result for pod: {}",
4747
failureData.getPod().getMetadata().getName()))
4848
.onFailure()
49-
.retry()
50-
.withBackOff(java.time.Duration.ofSeconds(2), java.time.Duration.ofSeconds(30))
51-
.atMost(5)
52-
.onFailure()
5349
.invoke(
5450
throwable ->
5551
log.error(

0 commit comments

Comments
 (0)