unicorn 4.8.0 → 4.8.0.1.g10a2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/unicorn/http_server.rb +9 -2
  2. metadata +5 -5
@@ -591,6 +591,13 @@ class Unicorn::HttpServer
591
591
  EXIT_SIGS = [ :QUIT, :TERM, :INT ]
592
592
  WORKER_QUEUE_SIGS = QUEUE_SIGS - EXIT_SIGS
593
593
 
594
+ def nuke_listeners!(readers)
595
+ # only called from the worker, ordering is important here
596
+ tmp = readers.dup
597
+ readers.replace([false]) # ensure worker does not continue ASAP
598
+ tmp.each { |io| io.close rescue nil } # break out of IO.select
599
+ end
600
+
594
601
  # gets rid of stuff the worker has no business keeping track of
595
602
  # to free some resources and drops all sig handlers.
596
603
  # traps for USR1, USR2, and HUP may be set in the after_fork Proc
@@ -618,7 +625,7 @@ class Unicorn::HttpServer
618
625
  @after_fork = @listener_opts = @orig_app = nil
619
626
  readers = LISTENERS.dup
620
627
  readers << worker
621
- trap(:QUIT) { readers.each { |io| io.close }.replace([false]) }
628
+ trap(:QUIT) { nuke_listeners!(readers) }
622
629
  readers
623
630
  end
624
631
 
@@ -677,7 +684,7 @@ class Unicorn::HttpServer
677
684
  worker.tick = Time.now.to_i
678
685
  ret = IO.select(readers, nil, nil, @timeout) and ready = ret[0]
679
686
  rescue => e
680
- redo if nr < 0
687
+ redo if nr < 0 && readers[0]
681
688
  Unicorn.log_error(@logger, "listen loop error", e) if readers[0]
682
689
  end while readers[0]
683
690
  end
metadata CHANGED
@@ -2,15 +2,15 @@
2
2
  name: !binary |-
3
3
  dW5pY29ybg==
4
4
  version: !ruby/object:Gem::Version
5
- version: 4.8.0
6
- prerelease:
5
+ version: 4.8.0.1.g10a2
6
+ prerelease: 8
7
7
  platform: ruby
8
8
  authors:
9
9
  - Unicorn hackers
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-11 00:00:00.000000000 Z
13
+ date: 2014-01-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: !binary |-
@@ -351,9 +351,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
351
351
  required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  none: false
353
353
  requirements:
354
- - - ! '>='
354
+ - - ! '>'
355
355
  - !ruby/object:Gem::Version
356
- version: '0'
356
+ version: 1.3.1
357
357
  requirements: []
358
358
  rubyforge_project: !binary |-
359
359
  bW9uZ3JlbA==