puma 2.9.0 → 2.9.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd2e7a0ca1eba42615a406f35c0bbc304b91ee4c
4
- data.tar.gz: fe274c58f7d7722caa7a7d444b080873c271034b
3
+ metadata.gz: 4587d687f274e6f12836cc110a0b9f69800e96a2
4
+ data.tar.gz: deac8749f171c5b8a6bf10666ba748676f8e3049
5
5
  SHA512:
6
- metadata.gz: f021e24772d46c519e6edc358e25d3ab51bd65b6378918826bd647d7f08d1084c61f49e234c38c24113acdd075985a45f9bd83f7a1cb685526a36586af082ba3
7
- data.tar.gz: 8dfc80519eaa94052b3f377546c701b7d1b84efeb40b6345d894caa40369a467a2bfc37955ece93ea84f4cb5a5013e14ff3952ccaf58f0260e222a09e1a6ac72
6
+ metadata.gz: b555eb3bc18a5679d72540458a20813161cb828c9be652f861e74ca7b00be2f05f7c44594088cf6e578d8df3a96152d2fc105d68b01b5e350596fa32529bdf70
7
+ data.tar.gz: f4be4cc2cc0bd2d9f880047c3547a4204995bf54a127ca72fcbfcc3f6bfb3854499701406c56515b66bcb0067caee762b44cd8eff8dbeb91dfb5564a96aa3014
@@ -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:
@@ -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`
@@ -13,8 +13,8 @@ typedef struct {
13
13
  } ms_conn;
14
14
 
15
15
  void engine_free(ms_conn* conn) {
16
- BIO_free(conn->read);
17
- BIO_free(conn->write);
16
+ SSL_free(conn->ssl);
17
+ SSL_CTX_free(conn->ctx);
18
18
 
19
19
  free(conn);
20
20
  }
@@ -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
@@ -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
@@ -28,7 +28,7 @@ module Puma
28
28
  # too taxing on performance.
29
29
  module Const
30
30
 
31
- PUMA_VERSION = VERSION = "2.9.0".freeze
31
+ PUMA_VERSION = VERSION = "2.9.1".freeze
32
32
  CODE_NAME = "Team High Five".freeze
33
33
 
34
34
  FAST_TRACK_KA_TIMEOUT = 0.2
@@ -114,7 +114,7 @@ module Puma
114
114
 
115
115
  @todo << work
116
116
 
117
- if @waiting == 0 and @spawned < @max
117
+ if @waiting < @todo.size and @spawned < @max
118
118
  spawn_thread
119
119
  end
120
120
 
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.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-13 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack