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

   - Severity: Medium
   - Location:
   
`shenyu-register-center/shenyu-register-client/shenyu-register-client-http/src/main/java/org/apache/shenyu/register/client/http/HttpClientRegisterRepository.java:59,61`
 (static fields), `:127` (`uriRegisterDTO = registerDTO`), `:157` 
(`apiDocRegisterDTO = registerDTO`), `:171-180` (closeRepository)
   - 
   Description:
   `uriRegisterDTO` and `apiDocRegisterDTO` are `static` mutable fields 
overwritten on every `doPersistURI`/`doPersistApiDoc`. `closeRepository()` 
(priority-1 shutdown hook) only re-registers the *last*-registered URI and the 
*last*-registered apiDoc; every earlier one is skipped. Because the fields are 
`static`, multiple repository instances (multiple register types in one JVM, 
re-init, tests) share and overwrite each other's DTOs. No memory barrier 
between writer (register thread) and reader (shutdown hook thread).
   - 
   Impact:
   Graceful shutdown only offlines the most-recent apiDoc (URI is mitigated by 
the separate per-URI OFFLINE hook in 
`ShenyuClientURIExecutorSubscriber:105-115`); stale apiDoc state remains for 
all earlier docs. Cross-instance overwrite can offline the wrong DTO.
   - 
   Suggested fix:
   Make the fields instance (non-static) and collect all registered DTOs (e.g. 
a `ConcurrentHashMap`/set) so `closeRepository` can offline each.
   - 
   Confidence: High
   - Related existing: none — #6487 (heartbeat scheduler), #6559/FUNC-E4 
(register partial-failure) are different.
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in 
[`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.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