epugh commented on PR #5174:
URL: https://github.com/apache/solr/pull/5174#issuecomment-6245038369

   Found a bug while reviewing this against 
\`dev-docs/apis-v2-conventions.adoc\`: \`circuitBreaker\`, \`initParams\`, 
\`listener\`, and \`updateRequestProcessorChain\` are declared without 
\`REQUIRE_NAME\` in \`SolrConfig\`'s plugin registry, so 
\`SolrConfig#writeMap\` serializes them as a \`List\` rather than a name-keyed 
\`Map\`. \`GetConfig#filterByComponentName\`'s unconditional \`(Map)\` cast 
then throws a \`ClassCastException\` for any by-name lookup against these 
sections — reachable both via v1's \`componentName\` query param (pre-existing 
bug, predates this PR) and the new v2 \`GET 
/config/{component}/{componentName}\` path this PR adds. That surfaces as an 
uncaught 500 instead of the documented NOT_FOUND/404 convention.
   
   Reproduced with a throwaway test: \`GET .../config/circuitBreaker/x\` 500'd 
with the ClassCastException before this fix, returns a clean 404 after.
   
   Pushed a fix:
   - \`filterByComponentName\` now checks the section's shape and throws a 
clean \`NOT_FOUND\` when by-name filtering doesn't apply (fixes the v1 path 
too).
   - Dropped those 4 non-named sections from the v2 by-name \`@Path\` regex, 
since a route that can never match by name isn't useful API surface.
   - Also noticed \`cache\` has the same \`REQUIRE_NAME + MULTI_OK\` shape as 
the other sections this PR already pluralizes (\`listener\`→\`listeners\`, 
\`queryParser\`→\`queryParsers\`, etc.) but was left singular — renamed to 
\`caches\` for consistency.
   
   All existing tests pass (\`GetConfigTest\`, \`GetConfigSolrCloudTest\`, 
\`V2ConfigAPIMappingTest\`, \`TestSolrConfigHandler\`, 
\`TestSolrConfigHandlerCloud\`).


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to