puma 5.0.0-java → 5.0.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 +4 -4
- data/History.md +1126 -574
- data/ext/puma_http11/http11_parser.c +64 -64
- data/lib/puma.rb +5 -2
- data/lib/puma/binder.rb +2 -0
- data/lib/puma/client.rb +5 -1
- data/lib/puma/cluster.rb +2 -0
- data/lib/puma/const.rb +1 -1
- data/lib/puma/error_logger.rb +2 -2
- data/lib/puma/events.rb +5 -3
- data/lib/puma/launcher.rb +8 -0
- data/lib/puma/minissl.rb +8 -0
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/reactor.rb +2 -13
- data/lib/puma/runner.rb +4 -17
- data/lib/puma/server.rb +92 -64
- data/lib/puma/single.rb +1 -0
- data/lib/puma/thread_pool.rb +22 -2
- data/lib/puma/util.rb +1 -0
- metadata +2 -2
data/lib/puma/single.rb
CHANGED
data/lib/puma/thread_pool.rb
CHANGED
@@ -62,6 +62,8 @@ module Puma
|
|
62
62
|
end
|
63
63
|
|
64
64
|
@clean_thread_locals = false
|
65
|
+
@force_shutdown = false
|
66
|
+
@shutdown_mutex = Mutex.new
|
65
67
|
end
|
66
68
|
|
67
69
|
attr_reader :spawned, :trim_requested, :waiting
|
@@ -80,10 +82,12 @@ module Puma
|
|
80
82
|
with_mutex { @todo.size }
|
81
83
|
end
|
82
84
|
|
85
|
+
# @!attribute [r] pool_capacity
|
83
86
|
def pool_capacity
|
84
87
|
waiting + (@max - spawned)
|
85
88
|
end
|
86
89
|
|
90
|
+
# @!attribute [r] busy_threads
|
87
91
|
# @version 5.0.0
|
88
92
|
def busy_threads
|
89
93
|
with_mutex { @spawned - @waiting + @todo.size }
|
@@ -322,6 +326,19 @@ module Puma
|
|
322
326
|
@reaper.start!
|
323
327
|
end
|
324
328
|
|
329
|
+
# Allows ThreadPool::ForceShutdown to be raised within the
|
330
|
+
# provided block if the thread is forced to shutdown during execution.
|
331
|
+
def with_force_shutdown
|
332
|
+
t = Thread.current
|
333
|
+
@shutdown_mutex.synchronize do
|
334
|
+
raise ForceShutdown if @force_shutdown
|
335
|
+
t[:with_force_shutdown] = true
|
336
|
+
end
|
337
|
+
yield
|
338
|
+
ensure
|
339
|
+
t[:with_force_shutdown] = false
|
340
|
+
end
|
341
|
+
|
325
342
|
# Tell all threads in the pool to exit and wait for them to finish.
|
326
343
|
# Wait +timeout+ seconds then raise +ForceShutdown+ in remaining threads.
|
327
344
|
# Next, wait an extra +grace+ seconds then force-kill remaining threads.
|
@@ -356,8 +373,11 @@ module Puma
|
|
356
373
|
join.call(timeout)
|
357
374
|
|
358
375
|
# If threads are still running, raise ForceShutdown and wait to finish.
|
359
|
-
|
360
|
-
|
376
|
+
@shutdown_mutex.synchronize do
|
377
|
+
@force_shutdown = true
|
378
|
+
threads.each do |t|
|
379
|
+
t.raise ForceShutdown if t[:with_force_shutdown]
|
380
|
+
end
|
361
381
|
end
|
362
382
|
join.call(SHUTDOWN_GRACE_TIME)
|
363
383
|
|
data/lib/puma/util.rb
CHANGED
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: 5.0.
|
4
|
+
version: 5.0.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: 2020-09-
|
11
|
+
date: 2020-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|