yyqdbngt opened a new pull request, #2971:
URL: https://github.com/apache/rocketmq-dashboard/pull/2971
## Summary
- A single `null` element in a cluster snapshot now costs one entry instead
of 500-ing the
request. `ClusterService` skips null broker entries in the live-config
enrichment loop and the
per-broker config update loop, filters them out of `targetBrokers` and the
dedup address
collection, and `listProxies` filters null proxies before building the
result
(`List.copyOf` rejects null elements).
## Why
`ClusterProvider` is an interface: `RealClusterProvider` happens to never
emit nulls, but any
other implementation (k8s, mocks, future edits) can leave a null hole in
`brokers`/`proxies`.
Today that one null NPEs `listClusters`, `getCluster`,
`previewClusterConfig`,
`updateClusterConfig` and `listProxies` alike, because the service layer
dereferences every
element.
## Testing
- `mvn -Dtest=ClusterServiceTest,ClusterServiceRegistryTest test`: Tests
run: 48,
Failures: 0, Errors: 0, Skipped: 0 (43 + 5).
- New tests verified to fail on the unfixed code with NullPointer
(Tests run: 4, Errors: 4):
`listClustersShouldTolerateNullBrokerEntries`,
`updateClusterConfigShouldSkipNullBrokerEntries`,
`listProxiesShouldSkipNullProxyEntries`,
`previewConfigShouldSkipNullBrokerTargets`.
--
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]