Skip to content
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

Merged
merged 1 commit into from
Aug 27, 2018

Conversation

bp-FLN
Copy link
Contributor

@bp-FLN bp-FLN commented Aug 20, 2018

this is basically the same as #143, but for WorkerPoolImpl

@coveralls
Copy link

coveralls commented Aug 20, 2018

Coverage Status

Coverage decreased (-0.5%) to 70.275% when pulling b510425 on uberall:reload-scripts-on-reconnect into 7e40392 on gresrun:master.

Copy link
Owner

@gresrun gresrun left a 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"))) {
Copy link
Owner

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?

Copy link
Contributor Author

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");
Copy link
Owner

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.

Copy link
Contributor Author

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);
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@bp-FLN bp-FLN force-pushed the reload-scripts-on-reconnect branch from c3927ea to b510425 Compare August 27, 2018 13:19
@gresrun gresrun merged commit 88bab76 into gresrun:master Aug 27, 2018
@bp-FLN bp-FLN deleted the reload-scripts-on-reconnect branch August 27, 2018 21:12
@sar009
Copy link

sar009 commented Aug 30, 2018

@gresrun any idea when this fix will be available in maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants