unicorn 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +1 -0
- data/lib/unicorn.rb +2 -2
- data/lib/unicorn/const.rb +1 -1
- data/test/exec/test_exec.rb +16 -0
- data/unicorn.gemspec +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/lib/unicorn.rb
CHANGED
@@ -521,8 +521,8 @@ module Unicorn
|
|
521
521
|
reopen_logs or exit(alive ? 1 : 0)
|
522
522
|
end
|
523
523
|
end
|
524
|
-
rescue SystemExit => e
|
525
|
-
|
524
|
+
rescue SignalException, SystemExit => e
|
525
|
+
raise e
|
526
526
|
rescue Object => e
|
527
527
|
if alive
|
528
528
|
logger.error "Unhandled listen loop exception #{e.inspect}."
|
data/lib/unicorn/const.rb
CHANGED
data/test/exec/test_exec.rb
CHANGED
@@ -72,6 +72,22 @@ end
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
def test_exit_signals
|
76
|
+
%w(INT TERM QUIT).each do |sig|
|
77
|
+
File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
|
78
|
+
pid = xfork { redirect_test_io { exec($unicorn_bin, "-l#@addr:#@port") } }
|
79
|
+
wait_master_ready("test_stderr.#{pid}.log")
|
80
|
+
status = nil
|
81
|
+
assert_nothing_raised do
|
82
|
+
Process.kill(sig, pid)
|
83
|
+
pid, status = Process.waitpid2(pid)
|
84
|
+
end
|
85
|
+
reaped = File.readlines("test_stderr.#{pid}.log").grep(/reaped/)
|
86
|
+
assert_equal 1, reaped.size
|
87
|
+
assert status.exited?
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
75
91
|
def test_basic
|
76
92
|
File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
|
77
93
|
pid = fork do
|
data/unicorn.gemspec
CHANGED