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

   ## Current behavior
   `InstanceCheckService.setup` schedules both the periodic state checker and 
`syncDB` on one `ScheduledThreadPoolExecutor(1)`. `syncDB` synchronously 
persists every cached instance through mapper lookups and writes. While 
database access is slow or blocked, no state-check task can run on that 
executor.
   
   Concrete failure scenario: an instance was ONLINE, database synchronization 
blocks, then its heartbeats stop. The map can continue to expose ONLINE past 
the normal timeout because the checker is queued behind persistence. A large 
database batch also increases health-state age even when every query eventually 
succeeds. Catching exceptions alone cannot resolve this coupling.
   
   ## Source evidence
   - [Both tasks share one 
executor](https://github.com/apache/shenyu/blob/66d7d954ca37d651a5ad916f988a8081157a7ab4/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/InstanceCheckService.java#L85)
   - [Synchronous per-instance persistence 
loop](https://github.com/apache/shenyu/blob/66d7d954ca37d651a5ad916f988a8081157a7ab4/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/InstanceCheckService.java#L174)
   - [Database lookup/write 
implementation](https://github.com/apache/shenyu/blob/66d7d954ca37d651a5ad916f988a8081157a7ab4/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/InstanceInfoServiceImpl.java#L53)
   
   Source-based scheduling finding; blocked-database integration behavior has 
not been reproduced during issue preparation.
   
   ## Acceptance criteria
   - [ ] A latch-controlled persistence fake/database fault test blocks one 
synchronization round while the independently scheduled checker still advances 
liveness states on time.
   - [ ] Isolate or bound blocking persistence work so its latency cannot 
occupy the liveness scheduling lane; preserve bounded queueing and prevent 
overlapping full persistence rounds.
   - [ ] Define consistent observation snapshots/order so an older persistence 
completion cannot overwrite newer state.
   - [ ] Test persistence recovery, shutdown, multiple namespaces and cluster 
lifecycle/authority; do not create multiple uncontrolled state writers.
   - [ ] Measure/report check scheduling lag, persistence duration and state 
age for large instance populations.
   
   Related: #6496 tracks an exception cancelling the persistence schedule; 
#7717 tracks retention and recurring work. This issue concerns a still-running 
slow operation starving the health checker, even when no exception occurs.
   


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