Skip to content

Reload redis scripts on reconnect#149

Merged
gresrun merged 1 commit into
gresrun:masterfrom
uberall:reload-scripts-on-reconnect
Aug 27, 2018
Merged

Reload redis scripts on reconnect#149
gresrun merged 1 commit into
gresrun:masterfrom
uberall:reload-scripts-on-reconnect

Conversation

@bp-FLN

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

Copy link
Copy Markdown
Contributor

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

@coveralls

coveralls commented Aug 20, 2018

Copy link
Copy Markdown

Coverage Status

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

@gresrun gresrun left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
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)

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

sar009 commented Aug 30, 2018

Copy link
Copy Markdown

@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