puma 4.1.0-java → 4.1.1-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7dac51ad5fcb659c08fb2bf59c206b7805e9853d348783414a260c0ccbe01ed5
4
- data.tar.gz: 62abcd5a97888b7c2e8c236987588138217f024a6471410156f7077cc920f839
3
+ metadata.gz: d014c9b6cd9b7b4270a8fba7b5a23408f7a58aa010d9296f612bb740974a5c72
4
+ data.tar.gz: 725c17b258b7063bbbcd2ff1d35172258a853d013762541f35ab6af1882cc4c5
5
5
  SHA512:
6
- metadata.gz: 3b5adbfb751509e3bbed09ba4946e4ba3fb71341cbdae78b79c8cabce89446b31af37609ea910295c6ffe3827fc6cfcf367028cb7614a9e89211396f52d3f07e
7
- data.tar.gz: ad02001dd4a0e596209ab4a2238b7b6e9e2ca35c21926d30346c5c40669264b8e2647bfff7c5cf1b06924b13ba1cc002e5e7a62d799921f0e838c6ccf14e4324
6
+ metadata.gz: e81361dacd7dda921308c80868ccaa4c7f5788a16e779b73c9efef941f6df18429dac9fe9b98b38790b9e8e4988ad16caddb0702c706e2286e03d5c49602baf9
7
+ data.tar.gz: e16c1233ab6eb6b45a1c0dc2d6c16bfc47a5e0784014e0e862f7b1e054b881247e0ce9d36e2a855d47ee6bc3629262fc3cfc28f55b3f8d05297aab228e2a2280
data/History.md CHANGED
@@ -6,6 +6,13 @@
6
6
  * Bugfixes
7
7
  * Your bugfix goes here (#Github Number)
8
8
 
9
+ ## 4.1.1 / 2019-09-05
10
+
11
+ * 3 bugfixes
12
+ * Revert our attempt to not dup STDOUT/STDERR (#1946)
13
+ * Fix socket close on error (#1941)
14
+ * Fix workers not shutting down correctly (#1908)
15
+
9
16
  ## 4.1.0 / 2019-08-08
10
17
 
11
18
  * 4 features
@@ -15,7 +15,11 @@ module OpenSSL
15
15
  ssl.accept if @start_immediately
16
16
  ssl
17
17
  rescue SSLError => ex
18
- sock.close
18
+ if ssl
19
+ ssl.close
20
+ else
21
+ sock.close
22
+ end
19
23
  raise ex
20
24
  end
21
25
  end
@@ -35,34 +35,10 @@ module Puma
35
35
  @workers.each { |x| x.term }
36
36
 
37
37
  begin
38
- if RUBY_VERSION < '2.6'
39
- @workers.each do |w|
40
- begin
41
- Process.waitpid(w.pid)
42
- rescue Errno::ECHILD
43
- # child is already terminated
44
- end
45
- end
46
- else
47
- # below code is for a bug in Ruby 2.6+, above waitpid call hangs
48
- t_st = Process.clock_gettime(Process::CLOCK_MONOTONIC)
49
- pids = @workers.map(&:pid)
50
- loop do
51
- pids.reject! do |w_pid|
52
- begin
53
- if Process.waitpid(w_pid, Process::WNOHANG)
54
- log " worker status: #{$?}"
55
- true
56
- end
57
- rescue Errno::ECHILD
58
- true # child is already terminated
59
- end
60
- end
61
- break if pids.empty?
62
- sleep 0.5
63
- end
64
- t_end = Process.clock_gettime(Process::CLOCK_MONOTONIC)
65
- log format(" worker shutdown time: %6.2f", t_end - t_st)
38
+ loop do
39
+ wait_workers
40
+ break if @workers.empty?
41
+ sleep 0.2
66
42
  end
67
43
  rescue Interrupt
68
44
  log "! Cancelled waiting for workers"
@@ -99,6 +75,7 @@ module Puma
99
75
  @last_checkin = Time.now
100
76
  @last_status = '{}'
101
77
  @dead = false
78
+ @term = false
102
79
  end
103
80
 
104
81
  attr_reader :index, :pid, :phase, :signal, :last_checkin, :last_status, :started_at
@@ -120,6 +97,10 @@ module Puma
120
97
  @dead = true
121
98
  end
122
99
 
100
+ def term?
101
+ @term
102
+ end
103
+
123
104
  def ping!(status)
124
105
  @last_checkin = Time.now
125
106
  @last_status = status
@@ -134,9 +115,9 @@ module Puma
134
115
  if @first_term_sent && (Time.now - @first_term_sent) > @options[:worker_shutdown_timeout]
135
116
  @signal = "KILL"
136
117
  else
118
+ @term ||= true
137
119
  @first_term_sent ||= Time.now
138
120
  end
139
-
140
121
  Process.kill @signal, @pid
141
122
  rescue Errno::ESRCH
142
123
  end
@@ -227,12 +208,7 @@ module Puma
227
208
  # during this loop by giving the kernel time to kill them.
228
209
  sleep 1 if any
229
210
 
230
- pids = []
231
- while pid = Process.waitpid(-1, Process::WNOHANG) do
232
- pids << pid
233
- end
234
- @workers.reject! { |w| w.dead? || pids.include?(w.pid) }
235
-
211
+ wait_workers
236
212
  cull_workers
237
213
  spawn_workers
238
214
 
@@ -554,5 +530,24 @@ module Puma
554
530
  @wakeup.close
555
531
  end
556
532
  end
533
+
534
+ private
535
+
536
+ # loops thru @workers, removing workers that exited, and calling
537
+ # `#term` if needed
538
+ def wait_workers
539
+ @workers.reject! do |w|
540
+ begin
541
+ if Process.wait(w.pid, Process::WNOHANG)
542
+ true
543
+ else
544
+ w.term if w.term?
545
+ nil
546
+ end
547
+ rescue Errno::ECHILD
548
+ true # child is already terminated
549
+ end
550
+ end
551
+ end
557
552
  end
558
553
  end
@@ -100,7 +100,7 @@ module Puma
100
100
  # too taxing on performance.
101
101
  module Const
102
102
 
103
- PUMA_VERSION = VERSION = "4.1.0".freeze
103
+ PUMA_VERSION = VERSION = "4.1.1".freeze
104
104
  CODE_NAME = "Fourth and One".freeze
105
105
  PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
106
106
 
@@ -29,8 +29,8 @@ module Puma
29
29
  #
30
30
  def initialize(stdout, stderr)
31
31
  @formatter = DefaultFormatter.new
32
- @stdout = stdout.dup
33
- @stderr = stderr.dup
32
+ @stdout = stdout
33
+ @stderr = stderr
34
34
 
35
35
  @stdout.sync = true
36
36
  @stderr.sync = true
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: java
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.7.9
138
+ rubygems_version: 3.0.4
140
139
  signing_key:
141
140
  specification_version: 4
142
141
  summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for