SOLR-17764: retry CloudSolrClient requests failing with ClosedChannelException#4643
Open
serhiy-bzhezytskyy wants to merge 1 commit into
Open
SOLR-17764: retry CloudSolrClient requests failing with ClosedChannelException#4643serhiy-bzhezytskyy wants to merge 1 commit into
serhiy-bzhezytskyy wants to merge 1 commit into
Conversation
…Exception CloudSolrClient.wasCommError() classified only SocketException and UnknownHostException as communication errors worth retrying. A connection dropped mid-request surfaces as a ClosedChannelException (for example an HTTP/2 GOAWAY when a node shuts down), which was not retried even though maxRetries allowed it. Treat ClosedChannelException as a communication error so the request is retried on another node when one is available. Note: this does not by itself fix the graceful-shutdown failures tracked in SOLR-17764 (the underlying Jetty HTTP/2 client bug jetty#15368 discards an already-sent response, and a single-node cluster has no other node to retry on), but retrying a dropped connection is correct regardless.
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.
While looking into the graceful-shutdown test failures (SOLR-17764), I noticed
CloudSolrClient.wasCommError()only classifiesSocketExceptionandUnknownHostExceptionas communication errors worth retrying.A connection dropped mid-request surfaces as a
java.nio.channels.ClosedChannelException(for example an HTTP/2 GOAWAY when a node shuts down). That was not treated as a comm error, so the request was not retried even thoughmaxRetriesallowed it — the logs showcommError=falseand no retry. This is the kind of "connection error should be retried" case a couple of committers pointed at on SOLR-17764.Fix: treat
ClosedChannelExceptionas a communication error, alongside the existing two, so the request is retried on another node when one is available. Added a unit test for the classification.Scope / honesty: this does not by itself fix the graceful-shutdown failures in SOLR-17764.
TestGracefulJettyShutdown, retry cannot help because there is no other node to route to.So this is a standalone retry-robustness improvement that is correct on its own merits, not a fix for the graceful-shutdown issue. Details and experiments posted on SOLR-17764.