9z0b3t1c / capistrano-resque

Capistrano integration for Resque
MIT License
223 stars 144 forks source link

Sometimes resque:scheduler:restart doesnt kill active process, instead it spawns new one #107

Open ruslansavenok opened 8 years ago

ruslansavenok commented 8 years ago

When running cap develop resque:scheduler:restart, sometimes it doesnt kill active process from pid, instead it spawns new one. Server is running on ubuntu 14

capistrano - 3.4.0 capistrano-resque - 0.2.2 resque - 1.25.2

ps aux | grep resque-scheduler-4.0.0
root      6137  0.0  0.3 1063524 119632 ?      Sl   Dec16   0:10 resque-scheduler-4.0.0[server_production]: Processing Delayed Items
root      9200  0.0  0.3 1055524 111196 ?      Sl   02:34   0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root     13567  0.0  0.3 1055560 111424 ?      Sl   02:35   0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root     18716  0.0  0.3 1054792 112568 ?      Sl   02:36   0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root     24277  0.0  0.3 1055884 111696 ?      Sl   02:31   0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root     24977  0.0  0.3 1055080 110952 ?      Sl   02:37   0:00 resque-scheduler-4.0.0[server_develop]: Schedules Loaded
root     25345  0.0  0.0  11848   932 pts/4    S+   02:37   0:00 grep --color=auto resque-scheduler-4.0.0
Joachim-42he commented 4 years ago

Same with capistranoe-resque 0.2.3.

Posible reason for resque:scheduler:restart to fail: Capistrano-resque stops the scheduler with

execute :kill, "-s #{fetch(:resque_kill_signal)} $(cat #{pid}); rm #{pid}"

(capistrano-resque.rake:144)

:resque_kill_signaldefaults to SIGQUITSince the return of kill is not read, even if it fails, the PIDfile is removed and a new process will be started (with a new PIDfile).