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

   ## Description
   `ShenyuClientRegisterEventPublisher` is a singleton, but `start()` is 
invoked once per client listener ctor (+ once for the `publisher` bean + a Tars 
duplicate). Each call constructs a brand-new `DisruptorProviderManage` with its 
own consumer thread and its own `ShenyuClientURIExecutorSubscriber`. The 
subscriber's `URIS` list is `static` (shared), while each subscriber's 
heartbeat `executor` is an instance field scheduled in its constructor. With N 
`start()` calls there are N heartbeat schedulers all iterating the same shared 
`URIS` list.
   
   ## Location
   ```
   shenyu-client-core/.../AbstractContextRefreshedEventListener.java:139
   shenyu-client-tars/.../TarsServiceBeanEventListener.java:80
   shenyu-client-autoconfig/.../ClientRegisterConfiguration.java:99-104
   ShenyuClientRegisterEventPublisher.java:53-61
   ShenyuClientURIExecutorSubscriber.java:50 (URIS is static)
   ```
   
   ## Impact
   Duplicate heartbeat traffic to the admin for every registered URI (2x for 
Tars alone), and orphaned Disruptor consumer threads for the process lifetime.
   
   ## Suggested fix
   Make `start()` idempotent (guard with an `AtomicBoolean`/`started` flag), 
and remove the redundant `publisher.start(...)` call in 
`TarsServiceBeanEventListener` line 80.
   
   ## Related existing issue(s)
   #6487 covers heartbeat scheduler *stop* after one full failure; this is 
about *duplicate* schedulers from non-idempotent start, distinct.
   
   _Identified during the 2026-08-02 audit; full list in 
[`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._


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