php-resque icon indicating copy to clipboard operation
php-resque copied to clipboard

prevents workers to stale when redis server went away

Open jesusch opened this issue 10 years ago • 7 comments

fix for #180

unfortunatelly I have no clue, why the first access on redis()->ping() does not throw the exception anyhow this will prevent worker from getting useless after a network failure or redis restart

jesusch avatar Apr 23 '15 14:04 jesusch

Throwing a CredisException instead of duplicating the error handling code would probably be a good idea.

That said, it's interesting that Credis itself doesn't handle this... The reason we don't is it's supposed to do it for us.

danhunsaker avatar Apr 23 '15 17:04 danhunsaker

I've updated the pull according to your comment

jesusch avatar Apr 24 '15 09:04 jesusch

Looks good to me.

I still find it odd that Credis doesn't handle that on its own, though. I wonder if it's handled correctly in a more recent version of the library...

danhunsaker avatar Apr 24 '15 14:04 danhunsaker

any chance that this pull requests gets merged?

jesusch avatar May 19 '15 08:05 jesusch

I had to update the commit due to missing constructor message on CredisException

jesusch avatar Jun 16 '15 08:06 jesusch

:+1:

danhunsaker avatar Jun 05 '16 01:06 danhunsaker

I think in theory this should also be covered by #229, which was just merged down - essentially, the next operation against Redis on an instance that's gone away will cause the worker to throw an exception (Resque_RedisException)

chrisboulton avatar Oct 14 '16 23:10 chrisboulton