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 03:28:26 UTC
[PR] fix(provider): report null vendor as missing in the provider registry [rocketmq-dashboard]
yyqdbngt opened a new pull request, #2970:
URL: https://github.com/apache/rocketmq-dashboard/pull/2970
## Summary
`InstanceProviderRegistry.forVendor` and `catalogFor` looked the vendor up
directly in an `EnumMap`. `EnumMap.get(null)` throws NPE, so a null vendor
crashed with a raw NullPointerException instead of the same 501
"No ... provider registered for vendor" that an unregistered vendor already
produces. Both lookups now map a null vendor onto the existing missing-entry
code path.
## Why
The registry is the single lookup SPI for vendor-scoped providers; current
call sites normalize a null `InstanceVO.vendor` to APACHE first, but the SPI
contract ("unknown vendor -> 501") should hold for null too, so a future
caller passing a raw persisted vendor cannot 500 the request with an NPE.
## Testing
```
cd server && mvn -Dtest="InstanceProviderRegistryTest" test
```
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
New regression tests `forVendorShouldReportNullVendorAsMissingTest` and
`catalogForShouldReportNullVendorAsMissingTest` assert the 501 BusinessException
(message "No ... provider registered for vendor null") instead of an NPE.
--
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(provider): report null vendor as missing in the provider registry [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #2970: fix(provider): report null vendor as missing in the provider registry
URL: https://github.com/apache/rocketmq-dashboard/pull/2970
--
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