puma 5.2.2 → 6.3.0
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 +483 -4
- data/README.md +101 -20
- data/bin/puma-wild +1 -1
- data/docs/architecture.md +50 -16
- data/docs/compile_options.md +38 -2
- data/docs/deployment.md +53 -67
- data/docs/fork_worker.md +1 -3
- data/docs/jungle/rc.d/README.md +1 -1
- data/docs/kubernetes.md +1 -1
- data/docs/nginx.md +1 -1
- data/docs/plugins.md +15 -15
- data/docs/rails_dev_mode.md +2 -3
- data/docs/restart.md +7 -7
- data/docs/signals.md +11 -10
- data/docs/stats.md +8 -8
- data/docs/systemd.md +65 -69
- data/docs/testing_benchmarks_local_files.md +150 -0
- data/docs/testing_test_rackup_ci_files.md +36 -0
- data/ext/puma_http11/extconf.rb +44 -13
- data/ext/puma_http11/http11_parser.c +24 -11
- data/ext/puma_http11/http11_parser.h +2 -2
- data/ext/puma_http11/http11_parser.java.rl +2 -2
- data/ext/puma_http11/http11_parser.rl +2 -2
- data/ext/puma_http11/http11_parser_common.rl +3 -3
- data/ext/puma_http11/mini_ssl.c +150 -23
- data/ext/puma_http11/org/jruby/puma/Http11.java +3 -3
- data/ext/puma_http11/org/jruby/puma/Http11Parser.java +50 -48
- data/ext/puma_http11/org/jruby/puma/MiniSSL.java +188 -102
- data/ext/puma_http11/puma_http11.c +18 -10
- data/lib/puma/app/status.rb +10 -7
- data/lib/puma/binder.rb +112 -62
- data/lib/puma/cli.rb +24 -20
- data/lib/puma/client.rb +162 -36
- data/lib/puma/cluster/worker.rb +31 -27
- data/lib/puma/cluster/worker_handle.rb +12 -1
- data/lib/puma/cluster.rb +102 -61
- data/lib/puma/commonlogger.rb +21 -14
- data/lib/puma/configuration.rb +78 -54
- data/lib/puma/const.rb +135 -97
- data/lib/puma/control_cli.rb +25 -20
- data/lib/puma/detect.rb +12 -2
- data/lib/puma/dsl.rb +308 -58
- data/lib/puma/error_logger.rb +20 -11
- data/lib/puma/events.rb +6 -126
- data/lib/puma/io_buffer.rb +39 -4
- data/lib/puma/jruby_restart.rb +2 -1
- data/lib/puma/{json.rb → json_serialization.rb} +1 -1
- data/lib/puma/launcher/bundle_pruner.rb +104 -0
- data/lib/puma/launcher.rb +114 -173
- data/lib/puma/log_writer.rb +147 -0
- data/lib/puma/minissl/context_builder.rb +30 -16
- data/lib/puma/minissl.rb +132 -38
- data/lib/puma/null_io.rb +5 -0
- data/lib/puma/plugin/systemd.rb +90 -0
- data/lib/puma/plugin/tmp_restart.rb +1 -1
- data/lib/puma/plugin.rb +2 -2
- data/lib/puma/rack/builder.rb +7 -7
- data/lib/puma/rack_default.rb +19 -4
- data/lib/puma/reactor.rb +19 -10
- data/lib/puma/request.rb +373 -153
- data/lib/puma/runner.rb +74 -28
- data/lib/puma/sd_notify.rb +149 -0
- data/lib/puma/server.rb +127 -136
- data/lib/puma/single.rb +13 -11
- data/lib/puma/state_file.rb +39 -7
- data/lib/puma/thread_pool.rb +33 -26
- data/lib/puma/util.rb +20 -15
- data/lib/puma.rb +28 -11
- data/lib/rack/handler/puma.rb +113 -86
- data/tools/Dockerfile +1 -1
- metadata +15 -10
- data/lib/puma/queue_close.rb +0 -26
- data/lib/puma/systemd.rb +0 -46
data/lib/puma/queue_close.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class ClosedQueueError < StandardError; end
|
2
|
-
module Puma
|
3
|
-
|
4
|
-
# Queue#close was added in Ruby 2.3.
|
5
|
-
# Add a simple implementation for earlier Ruby versions.
|
6
|
-
#
|
7
|
-
module QueueClose
|
8
|
-
def initialize
|
9
|
-
@closed = false
|
10
|
-
super
|
11
|
-
end
|
12
|
-
def close
|
13
|
-
@closed = true
|
14
|
-
end
|
15
|
-
def closed?
|
16
|
-
@closed
|
17
|
-
end
|
18
|
-
def push(object)
|
19
|
-
@closed ||= false
|
20
|
-
raise ClosedQueueError if @closed
|
21
|
-
super
|
22
|
-
end
|
23
|
-
alias << push
|
24
|
-
end
|
25
|
-
::Queue.prepend QueueClose
|
26
|
-
end
|
data/lib/puma/systemd.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'sd_notify'
|
4
|
-
|
5
|
-
module Puma
|
6
|
-
class Systemd
|
7
|
-
def initialize(events)
|
8
|
-
@events = events
|
9
|
-
end
|
10
|
-
|
11
|
-
def hook_events
|
12
|
-
@events.on_booted { SdNotify.ready }
|
13
|
-
@events.on_stopped { SdNotify.stopping }
|
14
|
-
@events.on_restart { SdNotify.reloading }
|
15
|
-
end
|
16
|
-
|
17
|
-
def start_watchdog
|
18
|
-
return unless SdNotify.watchdog?
|
19
|
-
|
20
|
-
ping_f = watchdog_sleep_time
|
21
|
-
|
22
|
-
log "Pinging systemd watchdog every #{ping_f.round(1)} sec"
|
23
|
-
Thread.new do
|
24
|
-
loop do
|
25
|
-
sleep ping_f
|
26
|
-
SdNotify.watchdog
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def watchdog_sleep_time
|
34
|
-
usec = Integer(ENV["WATCHDOG_USEC"])
|
35
|
-
|
36
|
-
sec_f = usec / 1_000_000.0
|
37
|
-
# "It is recommended that a daemon sends a keep-alive notification message
|
38
|
-
# to the service manager every half of the time returned here."
|
39
|
-
sec_f / 2
|
40
|
-
end
|
41
|
-
|
42
|
-
def log(str)
|
43
|
-
@events.log str
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|