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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 606df9e31f26a18cd3e3a1219615c9f6ac80b634
4
- data.tar.gz: 0c94555a3f56ed48cece59cadeb49539727f1483
3
+ metadata.gz: 0922d7405e2fb42668eb994933edfcc57234ab01
4
+ data.tar.gz: 8c287132402d71095f8210b61124fd75a7c96288
5
5
  SHA512:
6
- metadata.gz: 1f766ef76252ad9271a3523c04287cce012676173511c834b8f73cb8dce29ea07ad414cc48de219b6635123781d2a7a88a56caaaa1f20488709b99ea3685609e
7
- data.tar.gz: 3b7dd8bc4f8f8102b907009ce1a8dae858a770ddc1c99b584942bb6d63578a893bc6e1763216bcd3a0d9d2817ac435f37e9b00fad587b84fc0dbf403a5b604b7
6
+ metadata.gz: 999411b1b2fe55fa575aa87b2b513f7607fa79f8f83761d8685973386f1c097f2c8ea5b8613fd0e0c77982c51e432910e7ec31237aa2c0e6af981ebb7896819f
7
+ data.tar.gz: 5ea012d1b1689c4da2e2be5272bc8b3785e037b7e3368bc33a04108ee3904abf100ffc5fc9ee06618b28d499bedd40fc5dc7a36cbfb37608f0eacb7650d037fa
@@ -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
Binary file
@@ -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: java
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