puma 2.3.1 → 2.3.2

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,9 @@
1
+ === 2.3.2 / 2013-07-08
2
+
3
+ * 1 bug fix:
4
+
5
+ * Move starting control server to after daemonization.
6
+
1
7
  === 2.3.1 / 2013-07-06
2
8
 
3
9
  * 2 bug fixes:
@@ -287,7 +287,6 @@ module Puma
287
287
  end
288
288
 
289
289
  def graceful_stop
290
- @control.stop(true) if @control
291
290
  @runner.stop_blocked
292
291
  log "- Goodbye!"
293
292
  end
@@ -428,10 +427,6 @@ module Puma
428
427
 
429
428
  setup_signals
430
429
 
431
- if cont = @options[:control_url]
432
- start_control cont
433
- end
434
-
435
430
  @status = :run
436
431
 
437
432
  @runner.run
@@ -443,8 +438,10 @@ module Puma
443
438
  graceful_stop
444
439
  when :restart
445
440
  log "* Restarting..."
446
- @control.stop true if @control
441
+ @runner.before_restart
447
442
  restart!
443
+ when :exit
444
+ # nothing
448
445
  end
449
446
  end
450
447
 
@@ -467,44 +464,13 @@ module Puma
467
464
 
468
465
  if jruby?
469
466
  Signal.trap("INT") do
467
+ @status = :exit
470
468
  graceful_stop
471
469
  exit
472
470
  end
473
471
  end
474
472
  end
475
473
 
476
- def start_control(str)
477
- require 'puma/app/status'
478
-
479
- uri = URI.parse str
480
-
481
- app = Puma::App::Status.new self
482
-
483
- if token = @options[:control_auth_token]
484
- app.auth_token = token unless token.empty? or token == :none
485
- end
486
-
487
- control = Puma::Server.new app, @events
488
- control.min_threads = 0
489
- control.max_threads = 1
490
-
491
- case uri.scheme
492
- when "tcp"
493
- log "* Starting control server on #{str}"
494
- control.add_tcp_listener uri.host, uri.port
495
- when "unix"
496
- log "* Starting control server on #{str}"
497
- path = "#{uri.host}#{uri.path}"
498
-
499
- control.add_unix_listener path
500
- else
501
- error "Invalid control URI: #{str}"
502
- end
503
-
504
- control.run
505
- @control = control
506
- end
507
-
508
474
  def stop
509
475
  @status = :stop
510
476
  @runner.stop
@@ -175,6 +175,7 @@ module Puma
175
175
  def stop_blocked
176
176
  @status = :stop if @status == :run
177
177
  wakeup!
178
+ @control.stop(true) if @control
178
179
  Process.waitall
179
180
  end
180
181
 
@@ -258,6 +259,8 @@ module Puma
258
259
 
259
260
  redirect_io
260
261
 
262
+ start_control
263
+
261
264
  @cli.write_state
262
265
 
263
266
  @master_read, @worker_write = read, @wakeup
@@ -28,7 +28,7 @@ module Puma
28
28
  # too taxing on performance.
29
29
  module Const
30
30
 
31
- PUMA_VERSION = VERSION = "2.3.1".freeze
31
+ PUMA_VERSION = VERSION = "2.3.2".freeze
32
32
  CODE_NAME = "Delicious Thin Mints"
33
33
 
34
34
  FAST_TRACK_KA_TIMEOUT = 0.2
@@ -4,6 +4,7 @@ module Puma
4
4
  @cli = cli
5
5
  @options = cli.options
6
6
  @app = nil
7
+ @control = nil
7
8
  end
8
9
 
9
10
  def daemon?
@@ -22,6 +23,45 @@ module Puma
22
23
  @cli.error str
23
24
  end
24
25
 
26
+ def before_restart
27
+ @control.stop(true) if @control
28
+ end
29
+
30
+ def start_control
31
+ str = @options[:control_url]
32
+ return unless str
33
+
34
+ require 'puma/app/status'
35
+
36
+ uri = URI.parse str
37
+
38
+ app = Puma::App::Status.new @cli
39
+
40
+ if token = @options[:control_auth_token]
41
+ app.auth_token = token unless token.empty? or token == :none
42
+ end
43
+
44
+ control = Puma::Server.new app, @cli.events
45
+ control.min_threads = 0
46
+ control.max_threads = 1
47
+
48
+ case uri.scheme
49
+ when "tcp"
50
+ log "* Starting control server on #{str}"
51
+ control.add_tcp_listener uri.host, uri.port
52
+ when "unix"
53
+ log "* Starting control server on #{str}"
54
+ path = "#{uri.host}#{uri.path}"
55
+
56
+ control.add_unix_listener path
57
+ else
58
+ error "Invalid control URI: #{str}"
59
+ end
60
+
61
+ control.run
62
+ @control = control
63
+ end
64
+
25
65
  def output_header(mode)
26
66
  min_t = @options[:min_threads]
27
67
  max_t = @options[:max_threads]
@@ -22,6 +22,7 @@ module Puma
22
22
 
23
23
  def stop_blocked
24
24
  log "- Gracefully stopping, waiting for requests to finish"
25
+ @control.stop(true) if @control
25
26
  @server.stop(true)
26
27
  end
27
28
 
@@ -68,6 +69,8 @@ module Puma
68
69
 
69
70
  @cli.write_state
70
71
 
72
+ start_control
73
+
71
74
  @server = server = start_server
72
75
 
73
76
  unless @options[:daemon]
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "puma"
5
- s.version = "2.3.1"
5
+ s.version = "2.3.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Phoenix"]
9
- s.date = "2013-07-06"
9
+ s.date = "2013-07-09"
10
10
  s.description = "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications. Puma is intended for use in both development and production environments. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like Rubinius or JRuby."
11
11
  s.email = ["evan@phx.io"]
12
12
  s.executables = ["puma", "pumactl"]
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.3.1
4
+ version: 2.3.2
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-07-06 00:00:00.000000000 Z
12
+ date: 2013-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack