Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-puma for openSUSE:Factory checked in at 2021-03-15 10:56:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-puma (Old) and /work/SRC/openSUSE:Factory/.rubygem-puma.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-puma" Mon Mar 15 10:56:24 2021 rev:43 rq:879042 version:5.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-puma/rubygem-puma.changes 2021-02-20 22:12:14.639036123 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-puma.new.2401/rubygem-puma.changes 2021-03-15 10:56:25.737358538 +0100 @@ -1,0 +2,9 @@ +Mon Mar 15 04:30:12 UTC 2021 - Manuel Schnitzer <mschnit...@suse.com> + +- updated to version 5.2.2 + + * Bugfixes + * Add `#flush` and `#sync` methods to `Puma::NullIO` ([#2553]) + * Restore `sync=true` on `STDOUT` and `STDERR` streams ([#2557]) + +------------------------------------------------------------------- Old: ---- puma-5.2.1.gem New: ---- puma-5.2.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-puma.spec ++++++ --- /var/tmp/diff_new_pack.loowmT/_old 2021-03-15 10:56:26.177359214 +0100 +++ /var/tmp/diff_new_pack.loowmT/_new 2021-03-15 10:56:26.181359220 +0100 @@ -24,7 +24,7 @@ # Name: rubygem-puma -Version: 5.2.1 +Version: 5.2.2 Release: 0 %define mod_name puma %define mod_full_name %{mod_name}-%{version} ++++++ puma-5.2.1.gem -> puma-5.2.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.md new/History.md --- old/History.md 2021-02-05 23:27:02.000000000 +0100 +++ new/History.md 2021-03-02 17:07:50.000000000 +0100 @@ -1,3 +1,9 @@ +## 5.2.2 / 2021-02-22 + +* Bugfixes + * Add `#flush` and `#sync` methods to `Puma::NullIO` ([#2553]) + * Restore `sync=true` on `STDOUT` and `STDERR` streams ([#2557]) + ## 5.2.1 / 2021-02-05 * Bugfixes @@ -1702,6 +1708,8 @@ * Bugfixes * Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number) +[#2557]:https://github.com/puma/puma/pull/2557 "PR by @cjlarose, merged 2021-02-22" +[#2553]:https://github.com/puma/puma/pull/2553 "PR by @olivierbellone, merged 02-10-22" [#2550]:https://github.com/puma/puma/pull/2550 "PR by @MSP-Greg, merged 2021-02-05" [#2547]:https://github.com/puma/puma/pull/2547 "PR by @wildmaples, merged 2021-02-03" [#2543]:https://github.com/puma/puma/pull/2543 "PR by @MSP-Greg, merged 2021-02-01" Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docs/architecture.md new/docs/architecture.md --- old/docs/architecture.md 2021-02-05 23:27:02.000000000 +0100 +++ new/docs/architecture.md 2021-03-02 17:07:50.000000000 +0100 @@ -4,34 +4,37 @@ ![https://bit.ly/2iJuFky](images/puma-general-arch.png) -Puma is a threaded web server, processing requests across a TCP or UNIX socket. +Puma is a threaded Ruby HTTP application server, processing requests across a TCP or UNIX socket. -Workers accept connections from the socket and a thread in the worker's thread pool processes the client's request. +Puma processes (there can be one or many) accept connections from the socket via a thread (in the `Reactor` class). The connection, once fully buffered and read, moves in to the `todo` list, where it will be picked up by a free/waiting thread in the threadpool (the `ThreadPool` class). -Clustered mode is shown/discussed here. Single mode is analogous to having a single worker process. +Puma works in two main modes: cluster and single. In single mode, only one Puma process is booted. In cluster mode, a `master` process is booted, which prepares (and may boot) the application, and then uses the `fork()` system call to create 1 or more `child` processes. These `child` processes all listen to the same socket. The `master` process does not listen to the socket or process requests - its purpose is mostly to manage and listen for UNIX signals and possibly kill or boot `child` processes. -## Connection pipeline +We sometimes call `child` processes (or Puma processes in `single` mode) _workers_, and we sometimes call the threads created by Puma's `ThreadPool` _worker threads_. + +## How Requests Work ![https://bit.ly/2zwzhEK](images/puma-connection-flow.png) * Upon startup, Puma listens on a TCP or UNIX socket. - * The backlog of this socket is configured (with a default of 1024), determining how many established but unaccepted connections can exist concurrently. - * This socket backlog is distinct from the "backlog" of work as reported by the control server stats. The latter is the number of connections in that worker's "todo" set waiting for a worker thread. -* By default, a single, separate thread is used to receive HTTP requests across the socket. - * When at least one worker thread is available for work, a connection is accepted and placed in this request buffer - * This thread waits for entire HTTP requests to be received over the connection - * The time spent waiting for the HTTP request body to be received is exposed to the Rack app as `env['puma.request_body_wait']` (milliseconds) - * Once received, the connection is pushed into the "todo" set -* Worker threads pop work off the "todo" set for processing - * The thread processes the request via the rack application (which generates the HTTP response) - * The thread writes the response to the connection - * Finally, the thread become available to process another connection in the "todo" set + * The backlog of this socket is configured (with a default of 1024). This determines the size of the queue for unaccepted connections. Generally, this setting is unimportant and will never be hit in production use. If the backlog is full, the connection will be refused by the operating system. + * This socket backlog is distinct from the `backlog` of work as reported by `Puma.stats` or the control server. The backlog as reported by Puma is the number of connections in the process' `todo` set waiting for a thread from the `ThreadPool`. +* By default, a single, separate thread (created by the `Reactor` class) is used to read and buffer requests from the socket. + * When at least one worker thread is available for work, the reactor thread listens to the socket and accepts a request, if one is waiting. + * The reactor thread waits for the entire HTTP request to be received. + * The time spent waiting for the HTTP request body to be received is exposed to the Rack app as `env['puma.request_body_wait']` (milliseconds). + * Once fully buffered and received, the connection is pushed into the "todo" set. +* Worker threads pop work off the "todo" set for processing. + * The worker thread processes the request via `call`ing the configured Rack application. The Rack application generates the HTTP response. + * The worker thread writes the response to the connection. Note that while Puma buffers requests via a separate thread, it does not use a separate thread for responses. + * Once done, the thread become available to process another connection in the "todo" set. -### Disabling `queue_requests` +### `queue_requests` ![https://bit.ly/2zxCJ1Z](images/puma-connection-flow-no-reactor.png) -The `queue_requests` option is `true` by default, enabling the separate thread used to buffer requests as described above. +The `queue_requests` option is `true` by default, enabling the separate reactor thread used to buffer requests as described above. If set to `false`, this buffer will not be used for connections while waiting for the request to arrive. + In this mode, when a connection is accepted, it is added to the "todo" queue immediately, and a worker will synchronously do any waiting necessary to read the HTTP request from the socket. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/configuration.rb new/lib/puma/configuration.rb --- old/lib/puma/configuration.rb 2021-02-05 23:27:02.000000000 +0100 +++ new/lib/puma/configuration.rb 2021-03-02 17:07:50.000000000 +0100 @@ -206,7 +206,8 @@ :first_data_timeout => Const::FIRST_DATA_TIMEOUT, :raise_exception_on_sigterm => true, :max_fast_inline => Const::MAX_FAST_INLINE, - :io_selector_backend => :auto + :io_selector_backend => :auto, + :mutate_stdout_and_stderr_to_sync_on_write => true, } end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/const.rb new/lib/puma/const.rb --- old/lib/puma/const.rb 2021-02-05 23:27:02.000000000 +0100 +++ new/lib/puma/const.rb 2021-03-02 17:07:50.000000000 +0100 @@ -100,7 +100,7 @@ # too taxing on performance. module Const - PUMA_VERSION = VERSION = "5.2.1".freeze + PUMA_VERSION = VERSION = "5.2.2".freeze CODE_NAME = "Fettisdagsbulle".freeze PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/dsl.rb new/lib/puma/dsl.rb --- old/lib/puma/dsl.rb 2021-02-05 23:27:02.000000000 +0100 +++ new/lib/puma/dsl.rb 2021-03-02 17:07:50.000000000 +0100 @@ -888,5 +888,9 @@ def io_selector_backend(backend) @options[:io_selector_backend] = backend.to_sym end + + def mutate_stdout_and_stderr_to_sync_on_write(enabled=true) + @options[:mutate_stdout_and_stderr_to_sync_on_write] = enabled + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/null_io.rb new/lib/puma/null_io.rb --- old/lib/puma/null_io.rb 2021-02-05 23:27:02.000000000 +0100 +++ new/lib/puma/null_io.rb 2021-03-02 17:07:50.000000000 +0100 @@ -36,6 +36,10 @@ true end + def sync + true + end + def sync=(v) end @@ -44,5 +48,9 @@ def write(*ary) end + + def flush + self + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/runner.rb new/lib/puma/runner.rb --- old/lib/puma/runner.rb 2021-02-05 23:27:02.000000000 +0100 +++ new/lib/puma/runner.rb 2021-03-02 17:07:50.000000000 +0100 @@ -126,6 +126,11 @@ STDERR.puts "=== puma startup: #{Time.now} ===" STDERR.flush unless STDERR.sync end + + if @options[:mutate_stdout_and_stderr_to_sync_on_write] + STDOUT.sync = true + STDERR.sync = true + end end def load_and_bind diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2021-02-05 23:27:02.000000000 +0100 +++ new/metadata 2021-03-02 17:07:50.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: puma version: !ruby/object:Gem::Version - version: 5.2.1 + version: 5.2.2 platform: ruby authors: - Evan Phoenix autorequire: bindir: bin cert_chain: [] -date: 2021-02-05 00:00:00.000000000 Z +date: 2021-03-02 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: nio4r @@ -140,7 +140,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.2.1 +rubygems_version: 3.2.3 signing_key: specification_version: 4 summary: Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for