Improve robustness around redis connection issues #26
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.
We've had periodic issues with redis where there will be some connection issues, the workers appear to reconnect successfully, but then they fail when they get new jobs with some weird cast exception. They stay alive polling until another new job pops up, which may be much later and then have:
While trying to troubleshoot, there were a few changes I wanted to make to better find the root cause:
WorkerImpl.recoverFromException
if there is anything but aJedisConnectionException
on reconnect, then the exception will not be handled untilrun
which only has a try/finally.jedis.isConnected() && jedis.ping().equals("PONG")
. This will further test the connection with an exchange of data.recoverFromException
implementation ingrails-jesque
first since I already have a GrailsWorkerImpl sublcass, but I could not access some of the private variables necessary to make it work. I changed some of those to protected so I could try some more things if I need to before making another pull request.