puma 3.12.1 → 5.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.

Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +1414 -448
  3. data/LICENSE +23 -20
  4. data/README.md +131 -60
  5. data/bin/puma-wild +3 -9
  6. data/docs/architecture.md +24 -19
  7. data/docs/compile_options.md +19 -0
  8. data/docs/deployment.md +38 -13
  9. data/docs/fork_worker.md +33 -0
  10. data/docs/jungle/README.md +9 -0
  11. data/{tools → docs}/jungle/rc.d/README.md +1 -1
  12. data/{tools → docs}/jungle/rc.d/puma +2 -2
  13. data/{tools → docs}/jungle/rc.d/puma.conf +0 -0
  14. data/docs/kubernetes.md +66 -0
  15. data/docs/nginx.md +1 -1
  16. data/docs/plugins.md +20 -10
  17. data/docs/rails_dev_mode.md +29 -0
  18. data/docs/restart.md +47 -22
  19. data/docs/signals.md +7 -6
  20. data/docs/stats.md +142 -0
  21. data/docs/systemd.md +48 -70
  22. data/ext/puma_http11/PumaHttp11Service.java +2 -2
  23. data/ext/puma_http11/ext_help.h +1 -1
  24. data/ext/puma_http11/extconf.rb +27 -0
  25. data/ext/puma_http11/http11_parser.c +84 -109
  26. data/ext/puma_http11/http11_parser.h +1 -1
  27. data/ext/puma_http11/http11_parser.java.rl +22 -38
  28. data/ext/puma_http11/http11_parser.rl +4 -2
  29. data/ext/puma_http11/http11_parser_common.rl +3 -3
  30. data/ext/puma_http11/mini_ssl.c +254 -91
  31. data/ext/puma_http11/no_ssl/PumaHttp11Service.java +15 -0
  32. data/ext/puma_http11/org/jruby/puma/Http11.java +108 -116
  33. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +89 -106
  34. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +92 -22
  35. data/ext/puma_http11/puma_http11.c +34 -50
  36. data/lib/puma.rb +54 -0
  37. data/lib/puma/app/status.rb +68 -49
  38. data/lib/puma/binder.rb +191 -139
  39. data/lib/puma/cli.rb +15 -15
  40. data/lib/puma/client.rb +257 -228
  41. data/lib/puma/cluster.rb +221 -212
  42. data/lib/puma/cluster/worker.rb +183 -0
  43. data/lib/puma/cluster/worker_handle.rb +90 -0
  44. data/lib/puma/commonlogger.rb +2 -2
  45. data/lib/puma/configuration.rb +58 -51
  46. data/lib/puma/const.rb +39 -19
  47. data/lib/puma/control_cli.rb +109 -67
  48. data/lib/puma/detect.rb +24 -3
  49. data/lib/puma/dsl.rb +519 -121
  50. data/lib/puma/error_logger.rb +104 -0
  51. data/lib/puma/events.rb +55 -31
  52. data/lib/puma/io_buffer.rb +7 -5
  53. data/lib/puma/jruby_restart.rb +0 -58
  54. data/lib/puma/json.rb +96 -0
  55. data/lib/puma/launcher.rb +178 -68
  56. data/lib/puma/minissl.rb +147 -48
  57. data/lib/puma/minissl/context_builder.rb +79 -0
  58. data/lib/puma/null_io.rb +13 -1
  59. data/lib/puma/plugin.rb +6 -12
  60. data/lib/puma/plugin/tmp_restart.rb +2 -0
  61. data/lib/puma/queue_close.rb +26 -0
  62. data/lib/puma/rack/builder.rb +2 -4
  63. data/lib/puma/rack/urlmap.rb +2 -0
  64. data/lib/puma/rack_default.rb +2 -0
  65. data/lib/puma/reactor.rb +85 -316
  66. data/lib/puma/request.rb +467 -0
  67. data/lib/puma/runner.rb +31 -52
  68. data/lib/puma/server.rb +282 -680
  69. data/lib/puma/single.rb +11 -67
  70. data/lib/puma/state_file.rb +8 -3
  71. data/lib/puma/systemd.rb +46 -0
  72. data/lib/puma/thread_pool.rb +129 -81
  73. data/lib/puma/util.rb +13 -6
  74. data/lib/rack/handler/puma.rb +5 -6
  75. data/tools/Dockerfile +16 -0
  76. data/tools/trickletest.rb +0 -1
  77. metadata +42 -26
  78. data/ext/puma_http11/io_buffer.c +0 -155
  79. data/lib/puma/accept_nonblock.rb +0 -23
  80. data/lib/puma/compat.rb +0 -14
  81. data/lib/puma/convenient.rb +0 -25
  82. data/lib/puma/daemon_ext.rb +0 -33
  83. data/lib/puma/delegation.rb +0 -13
  84. data/lib/puma/java_io_buffer.rb +0 -47
  85. data/lib/puma/rack/backports/uri/common_193.rb +0 -33
  86. data/lib/puma/tcp_logger.rb +0 -41
  87. data/tools/jungle/README.md +0 -19
  88. data/tools/jungle/init.d/README.md +0 -61
  89. data/tools/jungle/init.d/puma +0 -421
  90. data/tools/jungle/init.d/run-puma +0 -18
  91. data/tools/jungle/upstart/README.md +0 -61
  92. data/tools/jungle/upstart/puma-manager.conf +0 -31
  93. data/tools/jungle/upstart/puma.conf +0 -69
@@ -1,18 +0,0 @@
1
- #!/bin/bash
2
-
3
- # on system boot, and root have no rbenv installed,
4
- # after start-stop-daemon switched to current user, we have to init rbenv
5
- if [ -d "$HOME/.rbenv/bin" ]; then
6
- PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
7
- eval "$(rbenv init -)"
8
- elif [ -d "/usr/local/rbenv/bin" ]; then
9
- PATH="/usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH"
10
- eval "$(rbenv init -)"
11
- elif [ -f /usr/local/rvm/scripts/rvm ]; then
12
- source /etc/profile.d/rvm.sh
13
- elif [ -f "$HOME/.rvm/scripts/rvm" ]; then
14
- source "$HOME/.rvm/scripts/rvm"
15
- fi
16
-
17
- app=$1; config=$2; log=$3;
18
- cd $app && exec bundle exec puma -C $config >> $log 2>&1
@@ -1,61 +0,0 @@
1
- # Puma as a service using Upstart
2
-
3
- Manage multiple Puma servers as services on the same box using Ubuntu upstart.
4
-
5
- ## Installation
6
-
7
- # Copy the scripts to services directory
8
- sudo cp puma.conf puma-manager.conf /etc/init
9
-
10
- # Create an empty configuration file
11
- sudo touch /etc/puma.conf
12
-
13
- ## Managing the jungle
14
-
15
- Puma apps are referenced in /etc/puma.conf by default. Add each app's path as a new line, e.g.:
16
-
17
- ```
18
- /home/apps/my-cool-ruby-app
19
- /home/apps/another-app/current
20
- ```
21
-
22
- Start the jungle running:
23
-
24
- `sudo start puma-manager`
25
-
26
- This script will run at boot time.
27
-
28
- Start a single puma like this:
29
-
30
- `sudo start puma app=/path/to/app`
31
-
32
- ## Logs
33
-
34
- Everything is logged by upstart, defaulting to `/var/log/upstart`.
35
-
36
- Each puma instance is named after its directory, so for an app called `/home/apps/my-app` the log file would be `/var/log/upstart/puma-_home_apps_my-app.log`.
37
-
38
- ## Conventions
39
-
40
- * The script expects:
41
- * a config file to exist under `config/puma.rb` in your app. E.g.: `/home/apps/my-app/config/puma.rb`.
42
- * a temporary folder to put the PID, socket and state files to exist called `tmp/puma`. E.g.: `/home/apps/my-app/tmp/puma`. Puma will take care of the files for you.
43
-
44
- You can always change those defaults by editing the scripts.
45
-
46
- ## Here's what a minimal app's config file should have
47
-
48
- ```
49
- pidfile "/path/to/app/tmp/puma/pid"
50
- state_path "/path/to/app/tmp/puma/state"
51
- activate_control_app
52
- ```
53
-
54
- ## Before starting...
55
-
56
- You need to customise `puma.conf` to:
57
-
58
- * Set the right user your app should be running on unless you want root to execute it!
59
- * Look for `setuid apps` and `setgid apps`, uncomment those lines and replace `apps` to whatever your deployment user is.
60
- * Replace `apps` on the paths (or set the right paths to your user's home) everywhere else.
61
- * Uncomment the source lines for `rbenv` or `rvm` support unless you use a system wide installation of Ruby.
@@ -1,31 +0,0 @@
1
- # /etc/init/puma-manager.conf - manage a set of Pumas
2
-
3
- # This example config should work with Ubuntu 12.04+. It
4
- # allows you to manage multiple Puma instances with
5
- # Upstart, Ubuntu's native service management tool.
6
- #
7
- # See puma.conf for how to manage a single Puma instance.
8
- #
9
- # Use "stop puma-manager" to stop all Puma instances.
10
- # Use "start puma-manager" to start all instances.
11
- # Use "restart puma-manager" to restart all instances.
12
- # Crazy, right?
13
- #
14
-
15
- description "Manages the set of puma processes"
16
-
17
- # This starts upon bootup and stops on shutdown
18
- start on runlevel [2345]
19
- stop on runlevel [06]
20
-
21
- # Set this to the number of Puma processes you want
22
- # to run on this machine
23
- env PUMA_CONF="/etc/puma.conf"
24
-
25
- pre-start script
26
- for i in `cat $PUMA_CONF`; do
27
- app=`echo $i | cut -d , -f 1`
28
- logger -t "puma-manager" "Starting $app"
29
- start puma app=$app
30
- done
31
- end script
@@ -1,69 +0,0 @@
1
- # /etc/init/puma.conf - Puma config
2
-
3
- # This example config should work with Ubuntu 12.04+. It
4
- # allows you to manage multiple Puma instances with
5
- # Upstart, Ubuntu's native service management tool.
6
- #
7
- # See puma-manager.conf for how to manage all Puma instances at once.
8
- #
9
- # Save this config as /etc/init/puma.conf then manage puma with:
10
- # sudo start puma app=PATH_TO_APP
11
- # sudo stop puma app=PATH_TO_APP
12
- # sudo status puma app=PATH_TO_APP
13
- #
14
- # or use the service command:
15
- # sudo service puma {start,stop,restart,status}
16
- #
17
-
18
- description "Puma Background Worker"
19
-
20
- # no "start on", we don't want to automatically start
21
- stop on (stopping puma-manager or runlevel [06])
22
-
23
- # change apps to match your deployment user if you want to use this as a less privileged user (recommended!)
24
- setuid apps
25
- setgid apps
26
-
27
- respawn
28
- respawn limit 3 30
29
-
30
- instance ${app}
31
-
32
- script
33
- # this script runs in /bin/sh by default
34
- # respawn as bash so we can source in rbenv/rvm
35
- # quoted heredoc to tell /bin/sh not to interpret
36
- # variables
37
-
38
- # source ENV variables manually as Upstart doesn't, eg:
39
- #. /etc/environment
40
-
41
- exec /bin/bash <<'EOT'
42
- # set HOME to the setuid user's home, there doesn't seem to be a better, portable way
43
- export HOME="$(eval echo ~$(id -un))"
44
-
45
- if [ -d "/usr/local/rbenv/bin" ]; then
46
- export PATH="/usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH"
47
- elif [ -d "$HOME/.rbenv/bin" ]; then
48
- export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
49
- elif [ -f /etc/profile.d/rvm.sh ]; then
50
- source /etc/profile.d/rvm.sh
51
- elif [ -f /usr/local/rvm/scripts/rvm ]; then
52
- source /etc/profile.d/rvm.sh
53
- elif [ -f "$HOME/.rvm/scripts/rvm" ]; then
54
- source "$HOME/.rvm/scripts/rvm"
55
- elif [ -f /usr/local/share/chruby/chruby.sh ]; then
56
- source /usr/local/share/chruby/chruby.sh
57
- if [ -f /usr/local/share/chruby/auto.sh ]; then
58
- source /usr/local/share/chruby/auto.sh
59
- fi
60
- # if you aren't using auto, set your version here
61
- # chruby 2.0.0
62
- fi
63
-
64
- cd $app
65
- logger -t puma "Starting server: $app"
66
-
67
- exec bundle exec puma -C config/puma.rb
68
- EOT
69
- end script