Aias00 opened a new issue, #6662:
URL: https://github.com/apache/shenyu/issues/6662
- Severity: High
- Location:
`shenyu-sync-data-center/shenyu-sync-data-http/src/main/java/org/apache/shenyu/sync/data/http/refresh/SelectorDataRefresh.java:71-81`
-
Description:
`if (CollectionUtils.isEmpty(data)) { ...;
data.forEach(pluginDataSubscriber::unSelectorSubscribe);
pluginDataSubscriber.refreshSelectorDataAll(); }`.
`CollectionUtils.isEmpty(null)` returns true, so the branch is entered with
`data == null`, then `data.forEach(...)` throws `NullPointerException`. If
`data` is an empty list, `forEach` is a no-op (unsubscribe nothing) and the
clear intent is not achieved. The ordering is also backwards (`forEach` before
`refreshSelectorDataAll`). Compare `PluginDataRefresh` which correctly calls
`refreshPluginDataAll()` first and returns before iterating.
-
Impact:
HTTP sync refresh with an empty/null selector group crashes the long-polling
task (NPE) or silently leaves stale selectors in cache.
-
Suggested fix:
Move `pluginDataSubscriber.refreshSelectorDataAll()` to before the empty
check, and return early when empty (same pattern as `PluginDataRefresh`).
-
Confidence: High
---
_Identified during the 2026-08-02 deep re-scan; full list in
[`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.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]