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

   - severity: Medium
   - files: 
`shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/UpstreamCheckService.java:468-496`
 vs `:213-235`
   - description: `fetchUpstreamData` creates `List<CommonUpstream> 
commonUpstreams = new LinkedList<>()` and `UPSTREAM_MAP.put(selectorDO.getId(), 
commonUpstreams)`. Later, `submitJust` does 
`MapUtils.computeIfAbsent(UPSTREAM_MAP, selectorId, k -> new 
CopyOnWriteArrayList<>())` — since the key already exists, it returns the 
**LinkedList**, then mutates it with `add`/`removeIf`. Meanwhile the scheduled 
`check` thread iterates the same list. LinkedList is not thread-safe and its 
iterator is fail-fast → CME.
   - impact: Registration/check races can throw CME inside the scheduler 
(silently swallowed) or lose upstream entries.
   - suggested_fix: Always store `CopyOnWriteArrayList` in `UPSTREAM_MAP`; have 
`fetchUpstreamData` build a `CopyOnWriteArrayList`.
   - confidence: Medium
   - related_existing: none.
   
   ---
   _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