-
Notifications
You must be signed in to change notification settings - Fork 131
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
Reload redis scripts on reconnect #149
Conversation
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 the great PR!
final String curQueue) { | ||
if (exception instanceof JedisConnectionException | ||
|| exception instanceof JedisNoScriptException | ||
|| (exception instanceof JedisDataException && exception.getMessage().equals("LOADING Redis is loading the dataset in memory"))) { |
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.
Can you break this long line?
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.
done (i actually moved it to a separate variable, as breaking inside the if was making it even more unreadable)
@@ -557,7 +556,16 @@ protected void recoverFromException(final String curQueue, final Exception ex) { | |||
final RecoveryStrategy recoveryStrategy = this.exceptionHandlerRef.get().onException(this, ex, curQueue); | |||
switch (recoveryStrategy) { | |||
case RECONNECT: | |||
LOG.info("Ignoring RECONNECT strategy in response to exception because this is a pool", ex); | |||
if (ex instanceof JedisNoScriptException) { | |||
LOG.info("got JedisNoScriptException while reconnecting, reloading redis scripts"); |
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.
Nit: Capital 'G' for start of sentence. Also, Redis should be capitalized.
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.
done
LOG.info("got JedisNoScriptException while reconnecting, reloading redis scripts"); | ||
loadRedisScripts(); | ||
} else { | ||
LOG.info("waiting for pool to reconnect to redis", ex); |
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.
Same. Also, consider adding the duration of the wait to the message.
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.
done
c3927ea
to
b510425
Compare
@gresrun any idea when this fix will be available in maven. |
this is basically the same as #143, but for
WorkerPoolImpl