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 {
244244 public WithHttpClientStep (RequestType requestType , V1Service service , Step next ) {
245245 super (next );
246246 this .requestType = requestType ;
247+ if (service == null ) {
248+ throw new IllegalArgumentException ("service cannot be null" );
249+ }
247250 this .service = service ;
248251 }
249252
@@ -359,18 +362,19 @@ public NextAction apply(Packet packet) {
359362
360363 return doNext (packet );
361364 } 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+ }
362371 // exponential back-off
363372 Integer retryCount = (Integer ) packet .get (RETRY_COUNT );
364373 if (retryCount == null ) {
365374 retryCount = 0 ;
366375 // Log warning if this is the first try. Do not log for retries to prevent
367376 // 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 );
374378 }
375379 long waitTime = Math .min ((2 << ++retryCount ) * SCALE , MAX ) + (R .nextInt (HIGH - LOW ) + LOW );
376380 packet .put (RETRY_COUNT , retryCount );
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public void withHttpClientStep_Health_logIfFailed() {
9292 assertThat (logRecords , containsFine (WLS_HEALTH_READ_FAILED , SERVER_NAME ));
9393 }
9494
95- @ Test
95+ // @Test - no longer retry for Health check
9696 public void withHttpClientStep_Health_nologIfFailedOnRetry () {
9797 V1Service service = Stub .createStub (V1ServiceStub .class );
9898 Step next = new MockStep (null );
You can’t perform that action at this time.
0 commit comments