File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
main/java/oracle/kubernetes/operator/wlsconfig
test/java/oracle/kubernetes/operator/wlsconfig Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,9 @@ static final class WithHttpClientStep extends Step {
244
244
public WithHttpClientStep (RequestType requestType , V1Service service , Step next ) {
245
245
super (next );
246
246
this .requestType = requestType ;
247
+ if (service == null ) {
248
+ throw new IllegalArgumentException ("service cannot be null" );
249
+ }
247
250
this .service = service ;
248
251
}
249
252
@@ -359,18 +362,19 @@ public NextAction apply(Packet packet) {
359
362
360
363
return doNext (packet );
361
364
} catch (Throwable t ) {
365
+ // do not retry for health check
366
+ if (RequestType .HEALTH .equals (requestType )) {
367
+ LOGGER .fine (
368
+ MessageKeys .WLS_HEALTH_READ_FAILED , packet .get (ProcessingConstants .SERVER_NAME ), t );
369
+ return doNext (packet );
370
+ }
362
371
// exponential back-off
363
372
Integer retryCount = (Integer ) packet .get (RETRY_COUNT );
364
373
if (retryCount == null ) {
365
374
retryCount = 0 ;
366
375
// Log warning if this is the first try. Do not log for retries to prevent
367
376
// filling up the log repeatedly with same log message
368
- if (RequestType .CONFIG .equals (requestType )) {
369
- LOGGER .warning (MessageKeys .WLS_CONFIGURATION_READ_FAILED , t );
370
- } else {
371
- LOGGER .fine (
372
- MessageKeys .WLS_HEALTH_READ_FAILED , packet .get (ProcessingConstants .SERVER_NAME ), t );
373
- }
377
+ LOGGER .warning (MessageKeys .WLS_CONFIGURATION_READ_FAILED , t );
374
378
}
375
379
long waitTime = Math .min ((2 << ++retryCount ) * SCALE , MAX ) + (R .nextInt (HIGH - LOW ) + LOW );
376
380
packet .put (RETRY_COUNT , retryCount );
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public void withHttpClientStep_Health_logIfFailed() {
92
92
assertThat (logRecords , containsFine (WLS_HEALTH_READ_FAILED , SERVER_NAME ));
93
93
}
94
94
95
- @ Test
95
+ // @Test - no longer retry for Health check
96
96
public void withHttpClientStep_Health_nologIfFailedOnRetry () {
97
97
V1Service service = Stub .createStub (V1ServiceStub .class );
98
98
Step next = new MockStep (null );
You can’t perform that action at this time.
0 commit comments