Ticket #428 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

[PATCH] Merb starting/stopping bug with clusters/daemonize

Reported by: hrvoje.marjanov..@gmail.com Assigned to:
Priority: medium Milestone: 0.5.3
Component: Merb Keywords:
Cc:

Description

Demonstration:

$ merb -c 2 -d 
Starting merb server on port: 4000
Starting merb server on port: 4001
[hanum..@hrvoje merb]$ merb -K all 
/home/hanuman/layered/clipshare_rails/merb/log/merb.4000.pid
killed PID 5187 with signal 1
/home/hanuman/layered/clipshare_rails/merb/log/merb.4001.pid
killed PID 5189 with signal 1

Looks good.

Now, let's say I make mistake and try to start merb twice:

merb -c 2 -d 
Starting merb server on port: 4000
Starting merb server on port: 4001
$ merb -c 2 -d 
Starting merb server on port: 4000
Starting merb server on port: 4001
$ merb -K all 
/home/hanuman/layered/clipshare_rails/merb/log/merb.4000.pid
Failed to kill! all

He leaves old meerbs running, but puts new pids if files in log dir. So it doesn't know how to stop them anymore. Only solution now is killing them manually.

Attachments

cluster_start_stop_error.patch (1.7 kB) - added by j.naga..@gmail.com on 01/10/08 02:58:32.

Change History

01/10/08 02:57:43 changed by j.naga..@gmail.com

  • priority changed from major to medium.
  • summary changed from merb stopping bug to [PATCH] Merb starting/stopping bug with clusters/daemonize.
  • milestone changed from 0.4.2 to 0.9.

Something like the attached patch works to fix it.

Raises an error and doesn't delete pid files if the process is already alive.

01/10/08 02:58:32 changed by j.naga..@gmail.com

  • attachment cluster_start_stop_error.patch added.

01/10/08 03:19:21 changed by j.naga..@gmail.com

Another option may be to just kill the current processes and start them again (treating it like a restart, since Merb has no restart option).

Or, just start any processes which aren't alive and don't raise an error (maybe just a puts).

Could create a restart option too.

01/14/08 11:55:09 changed by iv..@gweezlebur.com

  • milestone changed from 0.9 to 0.5.3.

Can we clean this up and get it ready for the next release? I like it.

01/28/08 14:31:18 changed by iv..@gweezlebur.com

  • status changed from new to closed.
  • resolution set to fixed.

(In [1331]) Tweaks for cluster start/stop -- Closes #428 -- thanks nagash (this stuff is better in 0.9)