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 CHANGED
@@ -1,3 +1,4 @@
1
+ v0.5.1 - exit correctly on INT/TERM, QUIT is still recommended, however
1
2
  v0.5.0 - {after,before}_fork API change, small tweaks/fixes
2
3
  v0.4.2 - fix Rails ARStore, FD leak prevention, descriptive proctitles
3
4
  v0.4.1 - Rails support, per-listener backlog and {snd,rcv}buf
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
- exit(e.status)
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
@@ -58,7 +58,7 @@ module Unicorn
58
58
  REQUEST_URI='REQUEST_URI'.freeze
59
59
  REQUEST_PATH='REQUEST_PATH'.freeze
60
60
 
61
- UNICORN_VERSION="0.5.0".freeze
61
+ UNICORN_VERSION="0.5.1".freeze
62
62
 
63
63
  UNICORN_TMP_BASE="unicorn".freeze
64
64
 
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{unicorn}
5
- s.version = "0.5.0"
5
+ s.version = "0.5.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Eric Wong"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Wong