Aias00 commented on code in PR #7257:
URL: https://github.com/apache/shenyu/pull/7257#discussion_r4111192189


##########
shenyu-client/shenyu-client-core/src/main/java/org/apache/shenyu/client/core/disruptor/subcriber/ShenyuClientURIExecutorSubscriber.java:
##########
@@ -52,13 +53,25 @@ public class ShenyuClientURIExecutorSubscriber implements 
ExecutorTypeSubscriber
     private final ShenyuClientRegisterRepository 
shenyuClientRegisterRepository;
     
     private final ScheduledThreadPoolExecutor executor;
+
+    private final long readinessTimeoutMillis;
     
     /**
      * Instantiates a new Shenyu client uri executor subscriber.
+     * URI readiness is bounded by {@code 
shenyu.client.uri.readyTimeoutMillis}, defaulting to three minutes.
+     * Unready URIs are logged and skipped so subsequent registration events 
can be processed.
      *
      * @param shenyuClientRegisterRepository the shenyu client register 
repository
      */
     public ShenyuClientURIExecutorSubscriber(final 
ShenyuClientRegisterRepository shenyuClientRegisterRepository) {
+        this(shenyuClientRegisterRepository, 
Long.getLong("shenyu.client.uri.readyTimeoutMillis", 
TimeUnit.MINUTES.toMillis(3)));

Review Comment:
   Non-blocking, but please pick one of the two before merge.
   
   This default is what decides how long a single unreachable URI can occupy 
the thread that drains URI registration events. `executor(...)` runs on that 
thread, so with 3 minutes a dead endpoint still delays every other URI in the 
batch and any URI event arriving meanwhile - better than the old unbounded 
loop, but three minutes is a long stall for a client starting up next to 
several services.
   
   `UriReadinessTimeoutTest` passes `100`, so it proves the mechanism and not 
the default.
   
   Either lower this (30s reads as a reasonable startup budget) or keep 3 min 
and move `awaitReadiness` off the consumer thread so a slow endpoint cannot 
delay its peers. Whichever you choose, the skip message at line 121 is then the 
only signal an operator gets - it should be WARN and name this property, since 
a URI that becomes ready after the deadline is never re-triggered.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to