Aias00 opened a new issue, #6499:
URL: https://github.com/apache/shenyu/issues/6499
### Current Behavior
Consul instance watch tasks can stop after a transient Consul error.
`ConsulInstanceRegisterRepository.watcherStart()` schedules
`watchConfigKeyValues(selectKey)` with `scheduleWithFixedDelay(...)`:
```java
watchFutures.add(this.executor.scheduleWithFixedDelay(
() -> this.watchConfigKeyValues(selectKey), 5,
Integer.parseInt(watchDelay), TimeUnit.SECONDS));
```
`watchConfigKeyValues()` calls `getHealthServices(...)`, which performs the
Consul blocking query. Neither the scheduled lambda nor
`watchConfigKeyValues()` catches exceptions. If the Consul request fails, the
exception escapes the fixed-delay task and later executions are suppressed by
the scheduler.
### Expected Behavior
A failed Consul watch poll should be logged and retried on the next delay
interval.
### Impact
After one transient Consul watch failure, the local
`watcherInstanceRegisterMap` may stop receiving instance updates for that
select key until the process restarts or the watch is re-created.
### Code Location
-
`shenyu-registry/shenyu-registry-consul/src/main/java/org/apache/shenyu/registry/consul/ConsulInstanceRegisterRepository.java`
- `watcherStart()` schedules the fixed-delay watch task.
- `watchConfigKeyValues()` and `getHealthServices()` allow exceptions from
Consul calls to escape.
--
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]