SOLR-7177: include the target URL when a ConcurrentUpdateSolrClient update fails to connect#4638
Open
serhiy-bzhezytskyy wants to merge 1 commit into
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.
Contributor
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.