You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, we have the following issue (1.26.0).
We have Redis cluster, configured with Sentinels.
And there is problem: when Master Redis server down, there are approximately 3-5 seconds of Redis downtime, and when Worker trying request Redis - he died and need to start Worker again.
We were forced to create monkey patch like this one:
Resque::Worker.class_evaldodefwork(interval=5.0, &block)interval=Float(interval)
$0 ="resque: Starting"startuploopdobreakifshutdown?beginif not paused?andjob=reservelog_with_severity:info,"got: #{job.inspect}"job.worker=selfworking_onjobprocline"Processing #{job.queue} since #{Time.now.to_i} [#{job.payload_class_name}]"if@child=fork(job)srand# Reseedingprocline"Forked #{@child} at #{Time.now.to_i}"beginProcess.waitpid(@child)rescueSystemCallErrornilendjob.fail(DirtyExit.new("Child process received unhandled signal #{$?.stopsig}"))if $?.signaled?elseunregister_signal_handlersifwill_fork? && term_childbeginreconnectifwill_fork?perform(job, &block)rescueException=>exceptionreport_failed_job(job,exception)endifwill_fork?run_at_exit_hooks ? exit : exit!endenddone_working@child=nilelsebreakifinterval.zero?log_with_severity:debug,"Sleeping for #{interval} seconds"proclinepaused? ? "Paused" : "Waiting for #{queues.join(',')}"sleepintervalendrescueRedis::CannotConnectErrorsleepintervalendendunregister_workerrescueException=>exceptionunlessexception.class == SystemExit && !@child && run_at_exit_hookslog_with_severity:error,"Failed to start worker : #{exception.inspect}"unregister_worker(exception)endendend
catch Redis::CannotConnectError then sleep and try again. This prevent worker failing in case Redis Switching downtime.
Would be great to add any option to enable this kind of processing.
Thank you.
The text was updated successfully, but these errors were encountered:
Hello, we have the following issue (1.26.0).
We have Redis cluster, configured with Sentinels.
And there is problem: when Master Redis server down, there are approximately 3-5 seconds of Redis downtime, and when Worker trying request Redis - he died and need to start Worker again.
We were forced to create monkey patch like this one:
catch
Redis::CannotConnectError
then sleep and try again. This prevent worker failing in case Redis Switching downtime.Would be great to add any option to enable this kind of processing.
Thank you.
The text was updated successfully, but these errors were encountered: