puma 3.0.1-java → 3.0.2-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 +16 -0
- data/lib/puma/const.rb +1 -1
- data/lib/puma/control_cli.rb +9 -7
- data/lib/puma/plugin.rb +14 -1
- data/lib/puma/plugin/tmp_restart.rb +17 -5
- data/lib/puma/puma_http11.jar +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdf67a2718833f75de9167501a9b2c731d3b0ce5
|
4
|
+
data.tar.gz: bf1d38a64c51f079d6f4f7e849b5fd6158265971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2310c30304035538c68828bde59aa8e3a07bdae4468f3152711dbeb6a3b0e7e4b59762e4271dd6e5ef1551bab761fad11b5550cb59babc4d9fa66243f7ba06b
|
7
|
+
data.tar.gz: 357210543f7b79b78fd63eafc760a0eaa36f828a2f2548d64cdea91a534a1479b5fb430f1636bcfbb93e9e5e61df1def96201f16e587e4af5ef47ee67df6ab94
|
data/History.txt
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
=== 3.0.2 / 2016-02-26
|
2
|
+
|
3
|
+
* 5 bug fixes:
|
4
|
+
|
5
|
+
* Fix 'undefined local variable or method `pid` for #<Puma::ControlCLI:0x007f185fcef968>' when execute pumactl with `--pid` option.
|
6
|
+
* Fix 'undefined method `windows?` for Puma:Module' when execute pumactl.
|
7
|
+
* Harden tmp_restart against errors related to the restart file
|
8
|
+
* Make `plugin :tmp_restart` behavior correct in Windows.
|
9
|
+
* fix uninitialized constant Puma::ControlCLI::StateFile
|
10
|
+
|
11
|
+
* 3 PRs merged:
|
12
|
+
|
13
|
+
* Merge pull request #901 from mitto/fix-pumactl-uninitialized-constant-statefile
|
14
|
+
* Merge pull request #902 from corrupt952/fix_undefined_method_and_variable_when_execute_pumactl
|
15
|
+
* Merge pull request #905 from Eric-Guo/master
|
16
|
+
|
1
17
|
=== 3.0.1 / 2016-02-25
|
2
18
|
|
3
19
|
* 1 bug fix:
|
data/lib/puma/const.rb
CHANGED
data/lib/puma/control_cli.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'optparse'
|
2
|
+
require 'puma'
|
2
3
|
require 'puma/const'
|
4
|
+
require 'puma/detect'
|
3
5
|
require 'puma/configuration'
|
4
6
|
require 'uri'
|
5
7
|
require 'socket'
|
@@ -108,7 +110,7 @@ module Puma
|
|
108
110
|
raise "State file not found: #{@state}"
|
109
111
|
end
|
110
112
|
|
111
|
-
sf = StateFile.new
|
113
|
+
sf = Puma::StateFile.new
|
112
114
|
sf.load @state
|
113
115
|
|
114
116
|
@control_url = sf.control_url
|
@@ -177,24 +179,24 @@ module Puma
|
|
177
179
|
end
|
178
180
|
|
179
181
|
begin
|
180
|
-
Process.getpgid pid
|
182
|
+
Process.getpgid @pid
|
181
183
|
rescue SystemCallError
|
182
184
|
if @command == "restart"
|
183
185
|
start
|
184
186
|
else
|
185
|
-
raise "No pid '#{pid}' found"
|
187
|
+
raise "No pid '#{@pid}' found"
|
186
188
|
end
|
187
189
|
end
|
188
190
|
|
189
191
|
case @command
|
190
192
|
when "restart"
|
191
|
-
Process.kill "SIGUSR2", pid
|
193
|
+
Process.kill "SIGUSR2", @pid
|
192
194
|
|
193
195
|
when "halt"
|
194
|
-
Process.kill "QUIT", pid
|
196
|
+
Process.kill "QUIT", @pid
|
195
197
|
|
196
198
|
when "stop"
|
197
|
-
Process.kill "SIGTERM", pid
|
199
|
+
Process.kill "SIGTERM", @pid
|
198
200
|
|
199
201
|
when "stats"
|
200
202
|
puts "Stats not available via pid only"
|
@@ -205,7 +207,7 @@ module Puma
|
|
205
207
|
return
|
206
208
|
|
207
209
|
when "phased-restart"
|
208
|
-
Process.kill "SIGUSR1", pid
|
210
|
+
Process.kill "SIGUSR1", @pid
|
209
211
|
|
210
212
|
else
|
211
213
|
message "Puma is started"
|
data/lib/puma/plugin.rb
CHANGED
@@ -58,8 +58,21 @@ module Puma
|
|
58
58
|
Plugins = PluginRegistry.new
|
59
59
|
|
60
60
|
class Plugin
|
61
|
+
# Matches
|
62
|
+
# "C:/Ruby22/lib/ruby/gems/2.2.0/gems/puma-3.0.1/lib/puma/plugin/tmp_restart.rb:3:in `<top (required)>'"
|
63
|
+
# AS
|
64
|
+
# C:/Ruby22/lib/ruby/gems/2.2.0/gems/puma-3.0.1/lib/puma/plugin/tmp_restart.rb
|
65
|
+
CALLER_FILE = /
|
66
|
+
\A # start of string
|
67
|
+
.+ # file path (one or more characters)
|
68
|
+
(?= # stop previous match when
|
69
|
+
:\d+ # a colon is followed by one or more digits
|
70
|
+
:in # followed by a colon followed by in
|
71
|
+
)
|
72
|
+
/x
|
73
|
+
|
61
74
|
def self.extract_name(ary)
|
62
|
-
path = ary.first
|
75
|
+
path = ary.first[CALLER_FILE]
|
63
76
|
|
64
77
|
m = %r!puma/plugin/([^/]*)\.rb$!.match(path)
|
65
78
|
return m[1]
|
@@ -4,17 +4,29 @@ Puma::Plugin.create do
|
|
4
4
|
def start(launcher)
|
5
5
|
path = File.join("tmp", "restart.txt")
|
6
6
|
|
7
|
-
|
7
|
+
orig = nil
|
8
8
|
|
9
|
-
|
9
|
+
# If we can't write to the path, then just don't bother with this plugin
|
10
|
+
begin
|
11
|
+
File.write path, ""
|
12
|
+
orig = File.stat(path).mtime
|
13
|
+
rescue SystemCallError
|
14
|
+
return
|
15
|
+
end
|
10
16
|
|
11
17
|
in_background do
|
12
18
|
while true
|
13
19
|
sleep 2
|
14
20
|
|
15
|
-
|
16
|
-
|
17
|
-
|
21
|
+
begin
|
22
|
+
mtime = File.stat(path).mtime
|
23
|
+
rescue SystemCallError
|
24
|
+
# If the file has disappeared, assume that means don't restart
|
25
|
+
else
|
26
|
+
if mtime > orig
|
27
|
+
launcher.restart
|
28
|
+
break
|
29
|
+
end
|
18
30
|
end
|
19
31
|
end
|
20
32
|
end
|
data/lib/puma/puma_http11.jar
CHANGED
Binary file
|