unicorn 0.93.3 → 0.93.4

Sign up to get free protection for your applications and to get access to all the features.
data/CONTRIBUTORS CHANGED
@@ -1,5 +1,7 @@
1
1
  Unicorn developers:
2
2
  * Eric Wong
3
+ * Suraj N. Kurapati
4
+ * Andrey Stikheev
3
5
  * ... (help wanted)
4
6
 
5
7
  We would like to thank following folks for helping make Unicorn possible:
data/DESIGN CHANGED
@@ -55,6 +55,22 @@
55
55
  applications that are running all the time since worker processes
56
56
  will only select()/accept() outside of the application dispatch.
57
57
 
58
+ * Additionally, thundering herds are much smaller than with
59
+ configurations using existing prefork servers. Process counts should
60
+ only be scaled to backend resources, _never_ to the number of expected
61
+ clients like is typical with blocking prefork servers. So while we've
62
+ seen instances of popular prefork servers configured to run many
63
+ hundreds of worker processes, Unicorn deployments are typically only
64
+ 2-4 processes per-core.
65
+
66
+ * On-demand scaling of worker processes never happens automatically.
67
+ Again, Unicorn is concerned about scaling to backend limits and should
68
+ never configured in a fashion where it could be waiting on slow
69
+ clients. For extremely rare circumstances, we provide TTIN and TTOU
70
+ signal handlers to increment/decrement your process counts without
71
+ reloading. Think of it as driving a car with manual transmission:
72
+ you have a lot more control if you know what you're doing.
73
+
58
74
  * Blocking I/O is used for clients. This allows a simpler code path
59
75
  to be followed within the Ruby interpreter and fewer syscalls.
60
76
  Applications that use threads continue to work if Unicorn
data/GIT-VERSION-GEN CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v0.93.3.GIT
4
+ DEF_VER=v0.93.4.GIT
5
5
 
6
6
  LF='
7
7
  '
data/KNOWN_ISSUES CHANGED
@@ -1,5 +1,18 @@
1
1
  = Known Issues
2
2
 
3
+ * Rails 2.3.2 bundles its own version of Rack. This may cause subtle
4
+ bugs when simultaneously loaded with the system-wide Rack Rubygem
5
+ which Unicorn depends on. Upgrading to Rails 2.3.4 (or later) is
6
+ strongly recommended for all Rails 2.3.x users for this (and security
7
+ reasons). Rails 2.2.x series (or before) did not bundle Rack and are
8
+ should be unnaffected. If there is any reason which forces your
9
+ application to use Rails 2.3.2 and you have no other choice, then
10
+ you may edit your Unicorn gemspec and remove the Rack dependency.
11
+
12
+ ref: http://mid.gmane.org/20091014221552.GA30624@dcvr.yhbt.net
13
+ Note: the workaround described in the article above only made
14
+ the issue more subtle and we didn't notice them immediately.
15
+
3
16
  * Installing "unicorn" as a system-wide Rubygem and using the
4
17
  {isolate}[http://github.com/jbarnette/isolate] gem may cause issues if
5
18
  you're using any of the bundled application-level libraries in
data/README CHANGED
@@ -143,8 +143,8 @@ regarding this.
143
143
  All feedback (bug reports, user/development dicussion, patches, pull
144
144
  requests) go to the mailing list/newsgroup. Patches must be sent inline
145
145
  (git format-patch -M + git send-email). No subscription is necessary
146
- to post on the mailing list. No top posting. Address replies +To:+ (or
147
- +Cc:+) the original sender and +Cc:+ the mailing list.
146
+ to post on the mailing list. No top posting. Address replies +To:+
147
+ the mailing list.
148
148
 
149
149
  * email: mailto:mongrel-unicorn@rubyforge.org
150
150
  * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
data/Rakefile CHANGED
@@ -21,8 +21,8 @@ def tags
21
21
  body ||= "initial"
22
22
  {
23
23
  :time => Time.at(tagger.split(/ /)[-2].to_i).utc.strftime(timefmt),
24
- :tagger_name => %r{^tagger ([^<]+)}.match(tagger)[1],
25
- :tagger_email => %r{<([^>]+)>}.match(tagger)[1],
24
+ :tagger_name => %r{^tagger ([^<]+)}.match(tagger)[1].strip,
25
+ :tagger_email => %r{<([^>]+)>}.match(tagger)[1].strip,
26
26
  :id => `git rev-parse refs/tags/#{tag}`.chomp!,
27
27
  :tag => tag,
28
28
  :subject => subject,
@@ -58,7 +58,7 @@ task :news_atom do
58
58
  url = "#{cgit_url}/tag/?id=#{tag[:tag]}"
59
59
  link! :rel => "alternate", :type => "text/html", :href =>url
60
60
  id! url
61
- content(:type => 'text') { tag[:body] }
61
+ content({:type => 'text'}, tag[:body])
62
62
  end
63
63
  end
64
64
  end
data/lib/unicorn.rb CHANGED
@@ -341,16 +341,13 @@ module Unicorn
341
341
  # Terminates all workers, but does not exit master process
342
342
  def stop(graceful = true)
343
343
  self.listeners = []
344
- kill_each_worker(graceful ? :QUIT : :TERM)
345
- timeleft = timeout
346
- step = 0.2
347
- reap_all_workers
348
- until WORKERS.empty?
349
- sleep(step)
344
+ limit = Time.now + timeout
345
+ until WORKERS.empty? || Time.now > limit
346
+ kill_each_worker(graceful ? :QUIT : :TERM)
347
+ sleep(0.1)
350
348
  reap_all_workers
351
- (timeleft -= step) > 0 and next
352
- kill_each_worker(:KILL)
353
349
  end
350
+ kill_each_worker(:KILL)
354
351
  end
355
352
 
356
353
  private
@@ -33,10 +33,11 @@ module Unicorn
33
33
  # # will then kill off the old master process with a SIGQUIT.
34
34
  # old_pid = "#{server.config[:pid]}.oldbin"
35
35
  # if old_pid != server.pid
36
- # begin
37
- # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
38
- # Process.kill(sig, File.read(old_pid).to_i)
39
- # rescue Errno::ENOENT, Errno::ESRCH
36
+ # begin
37
+ # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
38
+ # Process.kill(sig, File.read(old_pid).to_i)
39
+ # rescue Errno::ENOENT, Errno::ESRCH
40
+ # end
40
41
  # end
41
42
  #
42
43
  # # optionally throttle the master from forking too quickly by sleeping
@@ -91,7 +92,7 @@ module Unicorn
91
92
  end
92
93
 
93
94
  def reload #:nodoc:
94
- instance_eval(File.read(config_file)) if config_file
95
+ instance_eval(File.read(config_file), config_file) if config_file
95
96
  end
96
97
 
97
98
  def commit!(server, options = {}) #:nodoc:
data/lib/unicorn/const.rb CHANGED
@@ -7,7 +7,7 @@ module Unicorn
7
7
  # gave about a 3% to 10% performance improvement over using the strings directly.
8
8
  # Symbols did not really improve things much compared to constants.
9
9
  module Const
10
- UNICORN_VERSION="0.93.3"
10
+ UNICORN_VERSION="0.93.4"
11
11
 
12
12
  DEFAULT_HOST = "0.0.0.0" # default TCP listen host address
13
13
  DEFAULT_PORT = 8080 # default TCP listen port
@@ -131,6 +131,7 @@ module Unicorn
131
131
  begin
132
132
  if parser.filter_body(dst, socket.readpartial(length, buf)).nil?
133
133
  @tmp.write(dst)
134
+ @tmp.seek(0, IO::SEEK_END) # workaround FreeBSD/OSX + MRI 1.8.x bug
134
135
  return dst
135
136
  end
136
137
  rescue EOFError
@@ -32,8 +32,10 @@ class TestConfigurator < Test::Unit::TestCase
32
32
  assert_equal "0.0.0.0:2007", meth.call('*:2007')
33
33
  assert_equal "0.0.0.0:2007", meth.call('2007')
34
34
  assert_equal "0.0.0.0:2007", meth.call(2007)
35
- assert_match %r{\A\d+\.\d+\.\d+\.\d+:2007\z}, meth.call('1:2007')
36
- assert_match %r{\A\d+\.\d+\.\d+\.\d+:2007\z}, meth.call('2:2007')
35
+
36
+ # the next two aren't portable, consider them unsupported for now
37
+ # assert_match %r{\A\d+\.\d+\.\d+\.\d+:2007\z}, meth.call('1:2007')
38
+ # assert_match %r{\A\d+\.\d+\.\d+\.\d+:2007\z}, meth.call('2:2007')
37
39
  end
38
40
 
39
41
  def test_config_invalid
data/unicorn.gemspec CHANGED
@@ -43,6 +43,10 @@ Gem::Specification.new do |s|
43
43
 
44
44
  s.test_files = test_files
45
45
 
46
+ # for people that are absolutely stuck on Rails 2.3.2 and can't
47
+ # up/downgrade to any other version, the Rack dependency may be
48
+ # commented out. Nevertheless, upgrading to Rails 2.3.4 or later is
49
+ # *strongly* recommended for security reasons.
46
50
  s.add_dependency(%q<rack>)
47
51
 
48
52
  # s.licenses = %w(GPLv2 Ruby) # licenses= method is not in older Rubygems
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.93.3
4
+ version: 0.93.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unicorn developers
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-09 00:00:00 -07:00
12
+ date: 2009-10-27 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency