puma 2.9.0-java → 2.9.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 +4 -4
- data/History.txt +12 -0
- data/docs/signals.md +1 -0
- data/ext/puma_http11/mini_ssl.c +2 -2
- data/lib/puma/cli.rb +12 -0
- data/lib/puma/cluster.rb +20 -5
- data/lib/puma/const.rb +1 -1
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/thread_pool.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0922d7405e2fb42668eb994933edfcc57234ab01
|
4
|
+
data.tar.gz: 8c287132402d71095f8210b61124fd75a7c96288
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 999411b1b2fe55fa575aa87b2b513f7607fa79f8f83761d8685973386f1c097f2c8ea5b8613fd0e0c77982c51e432910e7ec31237aa2c0e6af981ebb7896819f
|
7
|
+
data.tar.gz: 5ea012d1b1689c4da2e2be5272bc8b3785e037b7e3368bc33a04108ee3904abf100ffc5fc9ee06618b28d499bedd40fc5dc7a36cbfb37608f0eacb7650d037fa
|
data/History.txt
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 2.9.1 / 2014-09-05
|
2
|
+
|
3
|
+
* 4 bug fixes:
|
4
|
+
* Cleanup the SSL related structures properly, fixes memory leak
|
5
|
+
* Fix thread spawning edge case.
|
6
|
+
* Force a worker check after a worker boots, don't wait 5sec. Fixes #574
|
7
|
+
* Implement SIGHUP for logs reopening
|
8
|
+
|
9
|
+
* 2 PRs merged:
|
10
|
+
* Merge pull request #561 from theoldreader/sighup
|
11
|
+
* Merge pull request #570 from havenwood/spawn-thread-edge-case
|
12
|
+
|
1
13
|
=== 2.9.0 / 2014-07-12
|
2
14
|
|
3
15
|
* 1 minor feature:
|
data/docs/signals.md
CHANGED
@@ -38,5 +38,6 @@ Puma cluster responds to these signals:
|
|
38
38
|
- `TERM` send `TERM` to worker. Worker will attempt to finish then exit.
|
39
39
|
- `USR2` restart workers
|
40
40
|
- `USR1` restart workers in phases, a rolling restart.
|
41
|
+
- `HUP` reopen log files defined in stdout_redirect configuration parameter
|
41
42
|
- `INT` equivalent of sending Ctrl-C to cluster. Will attempt to finish then exit.
|
42
43
|
- `CHLD`
|
data/ext/puma_http11/mini_ssl.c
CHANGED
data/lib/puma/cli.rb
CHANGED
@@ -537,6 +537,14 @@ module Puma
|
|
537
537
|
log "*** SIGTERM not implemented, signal based gracefully stopping unavailable!"
|
538
538
|
end
|
539
539
|
|
540
|
+
begin
|
541
|
+
Signal.trap "SIGHUP" do
|
542
|
+
redirect_io
|
543
|
+
end
|
544
|
+
rescue Exception
|
545
|
+
log "*** SIGHUP not implemented, signal based logs reopening unavailable!"
|
546
|
+
end
|
547
|
+
|
540
548
|
if jruby?
|
541
549
|
Signal.trap("INT") do
|
542
550
|
@status = :exit
|
@@ -564,6 +572,10 @@ module Puma
|
|
564
572
|
true
|
565
573
|
end
|
566
574
|
|
575
|
+
def redirect_io
|
576
|
+
@runner.redirect_io
|
577
|
+
end
|
578
|
+
|
567
579
|
def stats
|
568
580
|
@runner.stats
|
569
581
|
end
|
data/lib/puma/cluster.rb
CHANGED
@@ -36,6 +36,12 @@ module Puma
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
def redirect_io
|
40
|
+
super
|
41
|
+
|
42
|
+
@workers.each { |x| x.hup }
|
43
|
+
end
|
44
|
+
|
39
45
|
class Worker
|
40
46
|
def initialize(idx, pid, phase)
|
41
47
|
@index = idx
|
@@ -82,6 +88,11 @@ module Puma
|
|
82
88
|
Process.kill "KILL", @pid
|
83
89
|
rescue Errno::ESRCH
|
84
90
|
end
|
91
|
+
|
92
|
+
def hup
|
93
|
+
Process.kill "HUP", @pid
|
94
|
+
rescue Errno::ESRCH
|
95
|
+
end
|
85
96
|
end
|
86
97
|
|
87
98
|
def spawn_workers
|
@@ -104,9 +115,9 @@ module Puma
|
|
104
115
|
end
|
105
116
|
|
106
117
|
def next_worker_index
|
107
|
-
all_positions = 0...@options[:workers]
|
118
|
+
all_positions = 0...@options[:workers]
|
108
119
|
occupied_positions = @workers.map { |w| w.index }
|
109
|
-
available_positions = all_positions.to_a - occupied_positions
|
120
|
+
available_positions = all_positions.to_a - occupied_positions
|
110
121
|
available_positions.first
|
111
122
|
end
|
112
123
|
|
@@ -114,8 +125,8 @@ module Puma
|
|
114
125
|
@workers.count { |w| !w.booted? } == 0
|
115
126
|
end
|
116
127
|
|
117
|
-
def check_workers
|
118
|
-
return if @next_check && @next_check >= Time.now
|
128
|
+
def check_workers(force=false)
|
129
|
+
return if !force && @next_check && @next_check >= Time.now
|
119
130
|
|
120
131
|
@next_check = Time.now + 5
|
121
132
|
|
@@ -172,6 +183,7 @@ module Puma
|
|
172
183
|
$0 = "puma: cluster worker #{index}: #{master}"
|
173
184
|
Signal.trap "SIGINT", "IGNORE"
|
174
185
|
|
186
|
+
@workers = []
|
175
187
|
@master_read.close
|
176
188
|
@suicide_pipe.close
|
177
189
|
|
@@ -345,6 +357,8 @@ module Puma
|
|
345
357
|
begin
|
346
358
|
res = IO.select([read], nil, nil, 5)
|
347
359
|
|
360
|
+
force_check = false
|
361
|
+
|
348
362
|
if res
|
349
363
|
req = read.read_nonblock(1)
|
350
364
|
|
@@ -357,6 +371,7 @@ module Puma
|
|
357
371
|
when "b"
|
358
372
|
w.boot!
|
359
373
|
log "- Worker #{w.index} (pid: #{pid}) booted, phase: #{w.phase}"
|
374
|
+
force_check = true
|
360
375
|
when "p"
|
361
376
|
w.ping!
|
362
377
|
end
|
@@ -370,7 +385,7 @@ module Puma
|
|
370
385
|
@phased_restart = false
|
371
386
|
end
|
372
387
|
|
373
|
-
check_workers
|
388
|
+
check_workers force_check
|
374
389
|
|
375
390
|
rescue Interrupt
|
376
391
|
@status = :stop
|
data/lib/puma/const.rb
CHANGED
data/lib/puma/puma_http11.jar
CHANGED
Binary file
|
data/lib/puma/thread_pool.rb
CHANGED
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: 2.9.
|
4
|
+
version: 2.9.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: 2014-
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|