unicorn 4.0.1.4.g406b → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document CHANGED
@@ -12,7 +12,14 @@ TODO
12
12
  NEWS
13
13
  ChangeLog
14
14
  LATEST
15
- lib
15
+ lib/unicorn.rb
16
+ lib/unicorn/configurator.rb
17
+ lib/unicorn/http_server.rb
18
+ lib/unicorn/preread_input.rb
19
+ lib/unicorn/stream_input.rb
20
+ lib/unicorn/tee_input.rb
21
+ lib/unicorn/util.rb
22
+ lib/unicorn/worker.rb
16
23
  unicorn_1
17
24
  unicorn_rails_1
18
25
  ISSUES
@@ -6,3 +6,5 @@ changelog_start: v1.1.5
6
6
  merge_html:
7
7
  unicorn_1: Documentation/unicorn.1.html
8
8
  unicorn_rails_1: Documentation/unicorn_rails.1.html
9
+ public_email: mongrel-unicorn@rubyforge.org
10
+ private_email: unicorn@bogomips.org
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v4.0.1.GIT
4
+ DEF_VER=v4.1.0.GIT
5
5
 
6
6
  LF='
7
7
  '
@@ -3,6 +3,9 @@
3
3
  Occasionally odd {issues}[link:ISSUES.html] arise without a transparent or
4
4
  acceptable solution. Those issues are documented here.
5
5
 
6
+ * Issues with FreeBSD jails can be worked around as documented by Tatsuya Ono:
7
+ http://mid.gmane.org/CAHBuKRj09FdxAgzsefJWotexw-7JYZGJMtgUp_dhjPz9VbKD6Q@mail.gmail.com
8
+
6
9
  * PRNGs (pseudo-random number generators) loaded before forking
7
10
  (e.g. "preload_app true") may need to have their internal state
8
11
  reset in the after_fork hook. Starting with \Unicorn 3.6.1, we
@@ -50,9 +50,14 @@ module Unicorn
50
50
  pp({ :inner_app => inner_app }) if $DEBUG
51
51
 
52
52
  # return value, matches rackup defaults based on env
53
+ # Unicorn does not support persistent connections, but Rainbows!
54
+ # and Zbatery both do. Users accustomed to the Rack::Server default
55
+ # middlewares will need ContentLength/Chunked middlewares.
53
56
  case ENV["RACK_ENV"]
54
57
  when "development"
55
58
  Rack::Builder.new do
59
+ use Rack::ContentLength
60
+ use Rack::Chunked
56
61
  use Rack::CommonLogger, $stderr
57
62
  use Rack::ShowExceptions
58
63
  use Rack::Lint
@@ -60,6 +65,8 @@ module Unicorn
60
65
  end.to_app
61
66
  when "deployment"
62
67
  Rack::Builder.new do
68
+ use Rack::ContentLength
69
+ use Rack::Chunked
63
70
  use Rack::CommonLogger, $stderr
64
71
  run inner_app
65
72
  end.to_app
@@ -78,8 +85,10 @@ module Unicorn
78
85
  end
79
86
  end
80
87
 
81
- def self.log_error(logger, message, exc)
82
- logger.error "#{message}: #{exc.message} (#{exc.class})"
88
+ def self.log_error(logger, prefix, exc)
89
+ message = exc.message
90
+ message = message.dump if /[[:cntrl:]]/ =~ message
91
+ logger.error "#{prefix}: #{message} (#{exc.class})"
83
92
  exc.backtrace.each { |line| logger.error(line) }
84
93
  end
85
94
  # :startdoc:
@@ -8,7 +8,7 @@
8
8
  # improve things much compared to constants.
9
9
  module Unicorn::Const
10
10
 
11
- UNICORN_VERSION = "4.0.1"
11
+ UNICORN_VERSION = "4.1.0"
12
12
 
13
13
  # default TCP listen host address (0.0.0.0, all interfaces)
14
14
  DEFAULT_HOST = "0.0.0.0"
@@ -408,14 +408,14 @@ class Unicorn::HttpServer
408
408
  end
409
409
 
410
410
  self.reexec_pid = fork do
411
- listener_fds = LISTENERS.map do |sock|
411
+ listener_fds = Hash[LISTENERS.map do |sock|
412
412
  # IO#close_on_exec= will be available on any future version of
413
413
  # Ruby that sets FD_CLOEXEC by default on new file descriptors
414
414
  # ref: http://redmine.ruby-lang.org/issues/5041
415
415
  sock.close_on_exec = false if sock.respond_to?(:close_on_exec=)
416
- sock.fileno
417
- end
418
- ENV['UNICORN_FD'] = listener_fds.join(',')
416
+ [ sock.fileno, sock ]
417
+ end]
418
+ ENV['UNICORN_FD'] = listener_fds.keys.join(',')
419
419
  Dir.chdir(START_CTX[:cwd])
420
420
  cmd = [ START_CTX[0] ].concat(START_CTX[:argv])
421
421
 
@@ -428,6 +428,10 @@ class Unicorn::HttpServer
428
428
  IO_PURGATORY << io
429
429
  io.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
430
430
  end
431
+
432
+ # exec(command, hash) works in at least 1.9.1+, but will only be
433
+ # required in 1.9.4/2.0.0 at earliest.
434
+ cmd << listener_fds if RUBY_VERSION >= "1.9.1"
431
435
  logger.info "executing #{cmd.inspect} (in #{Dir.pwd})"
432
436
  before_exec.call(self)
433
437
  exec(*cmd)
@@ -545,6 +549,7 @@ class Unicorn::HttpServer
545
549
  def init_worker_process(worker)
546
550
  # we'll re-trap :QUIT later for graceful shutdown iff we accept clients
547
551
  EXIT_SIGS.each { |sig| trap(sig) { exit!(0) } }
552
+ exit!(0) if (SIG_QUEUE & EXIT_SIGS)[0]
548
553
  WORKER_QUEUE_SIGS.each { |sig| trap(sig, nil) }
549
554
  trap(:CHLD, 'DEFAULT')
550
555
  SIG_QUEUE.clear
@@ -17,9 +17,9 @@ opts = {
17
17
  pid = fork do
18
18
  Isolate.now!(opts) do
19
19
  gem 'sqlite3-ruby', '1.2.5'
20
- gem 'raindrops', '0.6.1'
21
- gem 'kgio', '2.5.0'
22
- gem 'rack', '1.3.0'
20
+ gem 'raindrops', '0.7.0'
21
+ gem 'kgio', '2.6.0'
22
+ gem 'rack', '1.3.2'
23
23
  end
24
24
  end
25
25
  _, status = Process.waitpid2(pid)
@@ -179,7 +179,11 @@ class TestSocketHelper < Test::Unit::TestCase
179
179
  end if defined?(TCP_DEFER_ACCEPT)
180
180
 
181
181
  def test_ipv6only
182
- port = unused_port "#@test6_addr"
182
+ port = begin
183
+ unused_port "#@test6_addr"
184
+ rescue Errno::EINVAL
185
+ return
186
+ end
183
187
  sock = bind_listen "[#@test6_addr]:#{port}", :ipv6only => true
184
188
  cur = sock.getsockopt(:IPPROTO_IPV6, :IPV6_V6ONLY).unpack('i')[0]
185
189
  assert_equal 1, cur
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_dependency(%q<raindrops>, '~> 0.6')
39
39
 
40
40
  s.add_development_dependency('isolate', '~> 3.1')
41
- s.add_development_dependency('wrongdoc', '~> 1.5')
41
+ s.add_development_dependency('wrongdoc', '~> 1.6')
42
42
 
43
43
  # s.licenses = %w(GPLv2 Ruby) # licenses= method is not in older RubyGems
44
44
  end
metadata CHANGED
@@ -1,17 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicorn
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1551
5
- prerelease: 8
4
+ hash: 59
5
+ prerelease:
6
6
  segments:
7
7
  - 4
8
- - 0
9
8
  - 1
10
- - 4
11
- - g
12
- - 406
13
- - b
14
- version: 4.0.1.4.g406b
9
+ - 0
10
+ version: 4.1.0
15
11
  platform: ruby
16
12
  authors:
17
13
  - Unicorn hackers
@@ -19,7 +15,7 @@ autorequire:
19
15
  bindir: bin
20
16
  cert_chain: []
21
17
 
22
- date: 2011-08-03 00:00:00 Z
18
+ date: 2011-08-20 00:00:00 Z
23
19
  dependencies:
24
20
  - !ruby/object:Gem::Dependency
25
21
  name: rack
@@ -88,11 +84,11 @@ dependencies:
88
84
  requirements:
89
85
  - - ~>
90
86
  - !ruby/object:Gem::Version
91
- hash: 5
87
+ hash: 3
92
88
  segments:
93
89
  - 1
94
- - 5
95
- version: "1.5"
90
+ - 6
91
+ version: "1.6"
96
92
  type: :development
97
93
  version_requirements: *id005
98
94
  description: |-
@@ -123,23 +119,11 @@ extra_rdoc_files:
123
119
  - ChangeLog
124
120
  - LATEST
125
121
  - lib/unicorn.rb
126
- - lib/unicorn/app/exec_cgi.rb
127
- - lib/unicorn/app/inetd.rb
128
- - lib/unicorn/app/old_rails.rb
129
- - lib/unicorn/app/old_rails/static.rb
130
- - lib/unicorn/cgi_wrapper.rb
131
122
  - lib/unicorn/configurator.rb
132
- - lib/unicorn/const.rb
133
- - lib/unicorn/http_request.rb
134
- - lib/unicorn/http_response.rb
135
123
  - lib/unicorn/http_server.rb
136
- - lib/unicorn/launcher.rb
137
- - lib/unicorn/oob_gc.rb
138
124
  - lib/unicorn/preread_input.rb
139
- - lib/unicorn/socket_helper.rb
140
125
  - lib/unicorn/stream_input.rb
141
126
  - lib/unicorn/tee_input.rb
142
- - lib/unicorn/tmpio.rb
143
127
  - lib/unicorn/util.rb
144
128
  - lib/unicorn/worker.rb
145
129
  - ISSUES
@@ -418,14 +402,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
418
402
  required_rubygems_version: !ruby/object:Gem::Requirement
419
403
  none: false
420
404
  requirements:
421
- - - ">"
405
+ - - ">="
422
406
  - !ruby/object:Gem::Version
423
- hash: 25
407
+ hash: 3
424
408
  segments:
425
- - 1
426
- - 3
427
- - 1
428
- version: 1.3.1
409
+ - 0
410
+ version: "0"
429
411
  requirements: []
430
412
 
431
413
  rubyforge_project: mongrel