puma 2.5.0 → 2.5.1

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.

@@ -1,3 +1,10 @@
1
+ === 2.5.1 / 2013-08-13
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Keep jruby daemon mode from retrying on a hot restart
6
+ * Extract version from const.rb in gemspec
7
+
1
8
  === 2.5.0 / 2013-08-08
2
9
 
3
10
  * 2 minor features:
@@ -28,7 +28,7 @@ module Puma
28
28
  # too taxing on performance.
29
29
  module Const
30
30
 
31
- PUMA_VERSION = VERSION = "2.5.0".freeze
31
+ PUMA_VERSION = VERSION = "2.5.1".freeze
32
32
  CODE_NAME = "Astronaut Shoelaces"
33
33
 
34
34
  FAST_TRACK_KA_TIMEOUT = 0.2
@@ -21,15 +21,34 @@ module Puma
21
21
  raise SystemCallError.new(FFI.errno)
22
22
  end
23
23
 
24
+ PermKey = 'PUMA_DAEMON_PERM'
25
+ RestartKey = 'PUMA_DAEMON_RESTART'
26
+
27
+ # Called to tell things "Your now always in daemon mode,
28
+ # don't try to reenter it."
29
+ #
30
+ def self.perm_daemonize
31
+ ENV[PermKey] = "1"
32
+ end
33
+
24
34
  def self.daemon?
25
- ENV.key? 'PUMA_DAEMON_RESTART'
35
+ ENV.key?(PermKey) || ENV.key?(RestartKey)
26
36
  end
27
37
 
28
38
  def self.daemon_init
29
- return false unless ENV.key? 'PUMA_DAEMON_RESTART'
39
+ return true if ENV.key?(PermKey)
40
+
41
+ return false unless ENV.key? RestartKey
42
+
43
+ master = ENV[RestartKey]
44
+
45
+ # In case the master disappears early
46
+ begin
47
+ Process.kill "SIGUSR2", master.to_i
48
+ rescue SystemCallError => e
49
+ end
30
50
 
31
- master = ENV['PUMA_DAEMON_RESTART']
32
- Process.kill "SIGUSR2", master.to_i
51
+ ENV[RestartKey] = ""
33
52
 
34
53
  setsid
35
54
 
@@ -47,7 +47,9 @@ module Puma
47
47
  output_header "single"
48
48
 
49
49
  if jruby_daemon?
50
- unless already_daemon
50
+ if already_daemon
51
+ JRubyRestart.perm_daemonize
52
+ else
51
53
  pid = nil
52
54
 
53
55
  Signal.trap "SIGUSR2" do
@@ -3,9 +3,16 @@
3
3
  # This is only used when puma is a git dep from Bundler, so it's a little
4
4
  # weird.
5
5
 
6
+ d = File.read(File.expand_path("../lib/puma/const.rb", __FILE__))
7
+ if d =~ /VERSION = "(\d+\.\d+\.\d+)"/
8
+ version = $1
9
+ else
10
+ version = "0.0.1"
11
+ end
12
+
6
13
  Gem::Specification.new do |s|
7
14
  s.name = "puma"
8
- s.version = Puma::Const::PUMA_VERSION
15
+ s.version = version
9
16
 
10
17
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
18
  s.authors = ["Evan Phoenix"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-08 00:00:00.000000000 Z
12
+ date: 2013-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack