Skip to content

Fix shared Redis connection issue on Passenger

Matthias Käppler requested to merge github/fork/jirutka/fix-passenger into master

Created by: jirutka

When you’re using Passenger with smart-lv2 (default) or smart spawn method, Resque doesn’t recognize that it has been forked (due to caching) and should re-establish Redis connection. Then you can see this error message in log:

Redis::InheritedError, Tried to use a connection from a child process without reconnecting. You need to reconnect to Redis after forking.`

Note that Resque.after_fork { Resque.redis.client.reconnect } is not sufficient with Passenger’s smart spawn.

This solution is based on https://github.com/redis/redis-rb/wiki/redis-rb-on-Phusion-Passenger

Merge request reports