wa0x6e / php-resque-ex

PHP port of resque (Workers and Queueing), with phpredis support, and more logging options
MIT License
137 stars 92 forks source link

'RedisException' with message 'Connection lost' #16

Closed wildsurfer closed 10 years ago

wildsurfer commented 10 years ago

I'm experiencing issue on my production server. Sometimes process unexpectedly dies with this message:

PHP Fatal error:  Uncaught exception 'RedisException' with message 'Connection lost'

Actually the issue is obvious but I need some way to increase timeout or to force it to try again

wa0x6e commented 10 years ago

You could try increasing the timeout value on Redis side

wildsurfer commented 10 years ago

@kamisama

From the redis official documentation:

Client timeouts By default recent versions of Redis don't close the connection with the client if the client is idle for many seconds: the connection will remain open forever.

wa0x6e commented 10 years ago

What library are you using ? Credis or phpredis ?

wildsurfer commented 10 years ago

@kamisama phpredis 2.2.3

wa0x6e commented 10 years ago

I don't a solution for this yet.

Using pconnect instead of connect didn't help.

wildsurfer commented 10 years ago

@kamisama, thanks for help! Can you point me to the place in code where this exception rises? I will check if I can patch it quickly.

wa0x6e commented 10 years ago

I'm not really sure, as it's been a long time since my last commit, I'm not so familiar with the project anymore.

The only patch you can do is caught the exception. There is no way to reconnect the lost connection.

wildsurfer commented 10 years ago

@kamisama I see, 10x anyway!

jrschumacher commented 10 years ago

@wildsurfer this error is from the library: https://github.com/nicolasff/phpredis/blob/master/README.markdown#class-redisexception