SOLR-7177: include the target URL when a ConcurrentUpdateSolrClient update fails to connect - #4638
Conversation
…pdate fails to connect On a connection failure the runner passed the raw exception to the error handler with no indication of which server it was talking to. Wrap a non-Solr exception in a SolrServerException carrying the base URL, matching what the synchronous clients already do. A RemoteSolrException already carries its URL, so it is passed through unchanged.
|
the CI red here is two tests that this PR doesn't touch (it only adds the target URL to a CUSC connection-error log). checked both on clean main with the same CI seed:
a re-run should get this green. |
|
Are there any objections to its merger? I am ready to resolve them, just let me know. Thanks |
|
Seems fine to me. Not fully related to this issue, but on a custom branch many years ago, I dealt with that fragile expectation of a SolrServerException by just unrolling the exception chain to get the root cause rather than hoping the exception is a SolrServerException. |
|
Thanks Mark. On the exception chain — you're right that the assumption is fragile, and this PR arguably adds to it: the new branch wraps a Unrolling to the root cause is the better shape. I'd rather keep it out of this PR, since the change here is meant to be the narrow "which node was it?" fix, and unrolling changes what every Let me open a separate issue for it and reference your note. It would also help Is that the split you'd expect, or would you rather see them together? |
|
Yeah, I'd split it out. |
|
Created as SOLR-9355 rather than a new issue — Erick Erickson opened that one in 2016 asking for exactly this retry, and it turned out your note explains why it never fired. PR is #4678. What it came to: One thing I got wrong in my earlier reply here: I said unrolling to the root cause was the better shape. It isn't quite — Jetty's Your observation also generalised further than the split. Five places in Solr decide retriability with five different sets, and Nothing needed from you here; #4638 is unchanged. |
On a connection failure,
ConcurrentUpdateBaseSolrClient's runner passed the raw exception to the error handler with no indication of which server it was talking to — the original SOLR-7177 complaint. The synchronous clients already wrap connection failures with the URL (HttpJdkSolrClient,HttpSolrClient); this brings the async path in line.The runner now wraps a non-Solr exception in a
SolrServerExceptioncarrying the base URL. ARemoteSolrExceptionalready carries its URL, so it passes through unchanged.While verifying this I traced the SolrCloud distribution path (
SolrCmdDistributor.checkRetryviaErrorReportingConcurrentUpdateSolrClient) and it turned out to matter for retries, not just logging.checkRetryinspects the exception like this:On the Jetty path a connection failure arrives as a raw
ExecutionException, which hits theelsebranch and isn't recognized as retriable — so a transient failure to a replica isn't retried. Wrapping it as aSolrServerExceptionputs it in the shapecheckRetryunwraps viagetRootCause(), so a socket-rooted cause (e.g.ConnectException) is now correctly seen as retriable. This never stops a previously-retried case from retrying; it starts retrying the socket-rooted ones the async path was dropping. That overlaps with SOLR-9355.Tests added in
ConcurrentUpdateSolrClientTestBase(both transports): the reported error identifies the target server, and it's aSolrServerExceptionpreserving the original cause socheckRetrycan unwrap it.@markrmiller — you had reservations on this ticket back in 2015 (the client knows its own URL). The retry-path finding above is the part I'd flag: the async CUSC path wasn't producing the
SolrServerExceptionshapecheckRetrywas built to unwrap. Happy to adjust the approach.