You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/09/02 02:36:30 UTC
[PR] fix(broker): keep valid clusters when a registry probe returns null entries [rocketmq-dashboard]
yyqdbngt opened a new pull request, #2968:
URL: https://github.com/apache/rocketmq-dashboard/pull/2968
## Summary
- `ClusterService.probeRegistryEntry` renames every cluster returned by
`ClusterProvider.discoverClustersAt` before aggregating it. A single `null` element in that
list made the rename loop NPE, and the catch-all degraded the **entire** registry entry to
empty — discarding every valid cluster the probe had found.
- The method now treats a `null` discovery result as empty and skips `null` elements, keeping
all valid clusters from the response.
## Why
`ClusterProvider` is an interface; `RealClusterProvider` happens to never emit nulls, but any
other implementation (or a future edit) can return a list with a null hole. Today that one null
element silently wipes out the whole entry from the `/api/clusters/registry` listing instead of
costing a single cluster.
## Testing
- `mvn -Dtest=ClusterServiceRegistryTest,ClusterServiceTest test`: Tests run: 46,
Failures: 0, Errors: 0, Skipped: 0 (7 + 39).
- New `listRegistryClustersShouldKeepValidClustersWhenDiscoveryReturnsNullElementTest`
verified to fail on the unfixed code (Tests run: 7, Failures: 1) — the valid cluster is lost
because the NPE degrades the whole entry.
- New `listRegistryClustersShouldTreatNullDiscoveryResultAsEmptyTest` pins the null-list
behaviour (already safe via the catch-all, now explicit).
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(broker): keep valid clusters when a registry probe returns null entries [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #2968: fix(broker): keep valid clusters when a registry probe returns null entries
URL: https://github.com/apache/rocketmq-dashboard/pull/2968
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org