-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added retry logic if client request returns an error code that is configured for retrying #4409
Added retry logic if client request returns an error code that is configured for retrying #4409
Conversation
2a30ce3
to
1bccf28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this! My two cents:
- Either local or maskable is fine. Maskable means the change will be (automatically) propagated to different instances, but every instance could override the value locally. Local is simpler and has less overhead (as no propagation is needed). I would prefer to use LOCAL here.
- It's okay to write our own exponential backoff code.
janusgraph-es/src/main/java/org/janusgraph/diskstorage/es/ElasticSearchIndex.java
Outdated
Show resolved
Hide resolved
janusgraph-es/src/main/java/org/janusgraph/diskstorage/es/rest/RestElasticSearchClient.java
Outdated
Show resolved
Hide resolved
5354c7d
to
340b591
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @criminosis ! I have just some nitpicks below. Otherwise looks good.
janusgraph-es/src/main/java/org/janusgraph/diskstorage/es/rest/RestElasticSearchClient.java
Outdated
Show resolved
Hide resolved
janusgraph-es/src/main/java/org/janusgraph/diskstorage/es/rest/RestElasticSearchClient.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@criminosis please, feel free to squash the commits. However, notice that ElasticSearch tests are now failing:
Failures:
Error: RestClientSetupTest.testConnectBasicHttpConfigurationAllOptions:257 expected: <[408, 429]> but was: <null>
Error: Errors:
Error: RestClientSetupTest.testSSLDisableHostNameVerifierDefaultOff » InvalidUseOfMatchers
…figured for retrying Closes JanusGraph#4408 Added additional tests for coverage Included example of comma separated values for retry-error-codes config parameter Simplified retry loop logic Moved retry configurations into constructor and removed setters Signed-off-by: Allan Clements <criminosis@gmail.com>
c3961fc
to
d75cfe6
Compare
@porunov yeah, I just focused on compilation passing to present the new signatures in case you had feedback or further modification, etc. Fixed it all up, squashed and re-signed off again. Should be ready for review again 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for your contribution @criminosis !
Thank you @porunov & @li-boxuan , glad to finally get to find something to contribute back to JanusGraph! Out of curiosity I see it's been earmarked for the 1.1.0 milestone. Assuming the build completely passes and it gets merged will it go out into nightly build / release prior to the 1.1.0 release? Looking forward to getting this my cluster to see if it helps the issue that originally prompted this. |
Yes. If everything passes the snapshot release is automatically created for each merged commit for any supported branches ( |
Closes #4408
To wait between retries since the code being called into Elasticsearch's client appears to be the synchronous API I opted for just using
Thread.sleep
. If there's a better utility or if a different approach is desired happy change.Additionally I marked the new configuration options with the
LOCAL
flag. I noticedretry_on_conflict
went withMASKABLE
but it didn't seem readily apparent what further obligations would be needed to fulfill the "global" portion of that contract, so just figured it'd be best to start withLOCAL
and ask about it in the PR.Thank you for contributing to JanusGraph!
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
master
)?For code changes:
For documentation related changes: