serhiy-bzhezytskyy opened a new pull request, #4637:
URL: https://github.com/apache/solr/pull/4637

   Follow-up to the SOLR-3284 error path (David flagged this on #4632 as worth 
its own change).
   
   `RemoteSolrException(remoteHost, code, remoteError, skipRetry)` built its 
details with `Map.of(...)`, which rejects null values, so it threw 
`NullPointerException` when `remoteError` was null.
   
   A null `remoteError` is expected: `ConcurrentUpdateBaseSolrClient` calls 
this constructor in a `finally` block with `remoteError` still null whenever a 
non-OK response has no parseable error body (a proxy 502/503, a truncated or 
non-Solr response). The NPE then masked the actual HTTP status the exception 
was meant to carry. `HttpSolrClient` has a similar call site.
   
   Switched to `Utils.makeMap` (the map building idiom already used elsewhere 
in the code), which tolerates a null value. Added `RemoteSolrExceptionTest` 
covering the null case (the regression) plus the consumers of the resulting 
exception, and the non-null case.


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