Aias00 opened a new issue, #6498:
URL: https://github.com/apache/shenyu/issues/6498

   ### Current Behavior
   
   Consul registry TTL heartbeats can stop permanently after one 
`agentCheckPass` failure.
   
   `TtlScheduler.add()` schedules each heartbeat with 
`scheduleAtFixedRate(...)`:
   
   ```java
   this.scheduler.scheduleAtFixedRate(new ConsulHeartbeatTask(instanceId), ttl, 
ttl, TimeUnit.SECONDS);
   ```
   
   The task calls Consul directly and does not catch exceptions:
   
   ```java
   TtlScheduler.this.client.agentCheckPass(this.checkId);
   ```
   
   If Consul is temporarily unavailable or the request fails once, the 
exception escapes the fixed-rate task. `ScheduledThreadPoolExecutor` suppresses 
later executions of that periodic task after an uncaught exception.
   
   ### Expected Behavior
   
   A transient Consul heartbeat failure should be logged and retried on the 
next TTL interval. Exceptions should not escape the scheduled heartbeat task.
   
   ### Impact
   
   A registered instance can stop sending TTL pass updates after a single 
transient Consul error, causing Consul to mark it unhealthy until the instance 
re-registers or restarts.
   
   ### Code Location
   
   - 
`shenyu-registry/shenyu-registry-consul/src/main/java/org/apache/shenyu/registry/consul/TtlScheduler.java`
     - `add()` schedules the heartbeat task.
     - `ConsulHeartbeatTask.run()` calls `agentCheckPass(...)` without 
exception handling.
   


-- 
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