Changes: Some documentation updates, mainly to to switch bogomips.org to yhbt.net since the .org TLD won't be affordable in the near future. It should also be easier for devs to build gems themselves, since pandoc is no longer a dependency for building manpages. Rainbows! is maintained as long as anybody uses it, but I don't recommend using it (or Ruby :P) for new apps: https://yhbt.net/rainbows-public/20151020095934.GA19114@dcvr.yhbt.net/ * https://yhbt.net/rainbows/ * rainbows-public@yhbt.net * https://yhbt.net/rainbows-public/ * git clone https://yhbt.net/rainbows.git * https://yhbt.net/rainbows/NEWS.atom.xml * nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows * nntp://news.gmane.io/gmane.comp.lang.ruby.rainbows.general /me goes back to Perl 5 like it's 1999!
bogomips.org is due to expire, soon, and I'm not willing to pay extortionists at Ethos Capital/PIR/ICANN to keep a .org. So it's at yhbt.net, for now... Identity is overrated. Tor users can use .onions and kick ICANN to the curb: torsocks w3m http://rainbows.ou63pmih66umazou.onion/ torsocks git clone http://ou63pmih66umazou.onion/rainbows.git/ torsocks w3m http://ou63pmih66umazou.onion/rainbows-public/ While we're at it, switch news.gmane.org => news.gmane.io (but I suspect that'll need to be resynched since our mail "List-Id:" header is changing). --- .olddoc.yml | 20 ++++++++++++-------- Documentation/comparison.haml | 2 +- Documentation/rainbows.1.txt | 6 +++--- FAQ | 2 +- GNUmakefile | 2 +- HACKING | 4 ++-- README | 18 ++++++++++-------- Sandbox | 2 +- TUNING | 4 ++-- archive/rfmig.rb | 32 -------------------------------- archive/slrnpull.conf | 2 +- examples/reverse_proxy.ru | 2 +- lib/rainbows.rb | 2 +- lib/rainbows/configurator.rb | 4 ++-- lib/rainbows/epoll.rb | 2 +- lib/rainbows/reverse_proxy.rb | 2 +- rainbows.gemspec | 16 ++++++++-------- vs_Unicorn | 2 +- 18 files changed, 49 insertions(+), 75 deletions(-) delete mode 100644 archive/rfmig.rb diff --git a/.olddoc.yml b/.olddoc.yml index 3e776ef..a10528a 100644 --- a/.olddoc.yml +++ b/.olddoc.yml @@ -1,12 +1,10 @@ --- -cgit_url: https://bogomips.org/rainbows.git -git_url: https://bogomips.org/rainbows.git -rdoc_url: https://bogomips.org/rainbows/ +cgit_url: https://yhbt.net/rainbows.git/ +rdoc_url: https://yhbt.net/rainbows/ merge_html: rainbows_1: Documentation/rainbows.1.html Summary: Documentation/comparison.html -public_email: rainbows-public@bogomips.org -private_email: rainbows@bogomips.org +public_email: rainbows-public@yhbt.net noindex: - TODO - LATEST @@ -15,7 +13,13 @@ noindex: - Unicorn::SocketHelper - EM - Revactor -ml_url: https://bogomips.org/rainbows-public/ +ml_url: +- https://yhbt.net/rainbows-public/ +- http://ou63pmih66umazou.onion/rainbows-public/ +source_code: +- git clone https://yhbt.net/rainbows.git +- torsocks git clone http://ou63pmih66umazou.onion/rainbows.git nntp_url: - - nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows - - nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general +- nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows +- nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows +- nntp://news.gmane.io/gmane.comp.lang.ruby.rainbows.general diff --git a/Documentation/comparison.haml b/Documentation/comparison.haml index 4fd02eb..8586a0b 100644 --- a/Documentation/comparison.haml +++ b/Documentation/comparison.haml @@ -153,7 +153,7 @@ CoolioThread* and CoolioThread* requires Ruby 1.9 reasonable performance %li rack.input streaming is what makes - %a(href="http://upr.bogomips.org/") upload progress, + %a(href="http://yhbt.net/upr/") upload progress, and BOSH possible %li rack.input streaming is NOT compatible with current versions of nginx diff --git a/Documentation/rainbows.1.txt b/Documentation/rainbows.1.txt index cdf7863..94adb8a 100644 --- a/Documentation/rainbows.1.txt +++ b/Documentation/rainbows.1.txt @@ -1,5 +1,5 @@ % rainbows(1) Rainbows! User Manual -% Rainbows! Hackers <rainbows-public@bogomips.org> +% Rainbows! Hackers <rainbows-public@yhbt.net> % December 3, 2009 # NAME @@ -155,7 +155,7 @@ RACKUP_FILE, some frameworks do not require them. * [Rack RDoc][2] * [Rackup HowTo][3] -[1]: https://bogomips.org/rainbows/ +[1]: https://yhbt.net/rainbows/ [2]: http://rdoc.info/gems/r#/gems/rack/frames [3]: http://wiki.github.com/rack/rack/tutorial-rackup-howto -[4]: https://bogomips.org/rainbows/SIGNALS.html +[4]: https://yhbt.net/rainbows/SIGNALS.html diff --git a/FAQ b/FAQ index e3dd762..5f64786 100644 --- a/FAQ +++ b/FAQ @@ -64,7 +64,7 @@ requires a extra {patch}[http://haproxy.1wt.eu/download/patches/]. If you don't need streaming "rack.input", then nginx is a great HTTPS reverse proxy. -Refer to the {unicorn FAQ}[https://bogomips.org/unicorn/FAQ.html] on how +Refer to the {unicorn FAQ}[https://yhbt.net/unicorn/FAQ.html] on how to ensure redirects go to "https://" URLs. diff --git a/GNUmakefile b/GNUmakefile index af8be80..70cc708 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ # use GNU Make to run tests in parallel, and without depending on RubyGems all:: -RSYNC_DEST := bogomips.org:/srv/bogomips/rainbows +RSYNC_DEST := yhbt.net:/srv/yhbt/rainbows rfpackage := rainbows PLACEHOLDERS := rainbows_1 Summary diff --git a/HACKING b/HACKING index 31f2111..b2f30e5 100644 --- a/HACKING +++ b/HACKING @@ -13,7 +13,7 @@ Please wrap documentation at 72 characters-per-line or less (long URLs are exempt) so it is comfortably readable from terminals. When referencing mailing list posts, use -"https://bogomips.org/rainbows-public/<Message-ID>/" if possible since +"https://yhbt.net/rainbows-public/<Message-ID>/" if possible since the Message-ID remains searchable even if the website becomes unavailable. == Contributing @@ -38,7 +38,7 @@ distributed with git on on patch submission guidelines to follow. Just don't email the git mailing list or maintainer with Rainbows! patches :) No subscription is required to post to the mailing list at -rainbows-public@bogomips.org +rainbows-public@yhbt.net Please Cc: everyone on replies, as not everyone is subscribed. diff --git a/README b/README index 178990d..5fc3a31 100644 --- a/README +++ b/README @@ -51,7 +51,7 @@ network concurrency. * Designed for {Rack}[http://rack.github.io/], the standard for modern Ruby HTTP applications. -* Built on {unicorn}[https://bogomips.org/unicorn/], inheriting its +* Built on {unicorn}[https://yhbt.net/unicorn/], inheriting its process/socket management features such as transparent upgrades and Ruby configuration DSL. @@ -116,7 +116,7 @@ In APP_ROOT (where config.ru is located), run: For deployments, it can use a config file for Unicorn and \Rainbows!-specific options specified by the +--config-file/-c+ command-line switch. \Rainbows! accepts all options found in -{Unicorn::Configurator}[https://bogomips.org/unicorn/Unicorn/Configurator.html] +{Unicorn::Configurator}[https://yhbt.net/unicorn/Unicorn/Configurator.html] as well as the "\Rainbows!" block, so you can have the following in your config file: @@ -135,13 +135,13 @@ for more details. You can get the latest source via git from the following locations (these versions may not be stable): - https://bogomips.org/rainbows.git + https://yhbt.net/rainbows.git https://repo.or.cz/rainbows.git (mirror) You may browse the code from the web and download the latest snapshot tarballs here: -* https://bogomips.org/rainbows.git +* https://yhbt.net/rainbows.git * https://repo.or.cz/rainbows.git (gitweb) Inline patches (from "git format-patch") to the mailing list are @@ -175,8 +175,10 @@ requests) go to the mailing list. Patches must be sent inline (git format-patch -M + git send-email). No subscription is necessary to post on the mailing list. No top posting. -* email: mailto:rainbows-public@bogomips.org -* subscribe: mailto:rainbows-public+subscribe@bogomips.org -* archives: https://bogomips.org/rainbows-public/ +* email: mailto:rainbows-public@yhbt.net +* subscribe: mailto:rainbows-public+subscribe@yhbt.net +* archives: https://yhbt.net/rainbows-public/ + http://ou63pmih66umazou.onion/rainbows-public/ nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows - nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general + nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows + nntp://news.gmane.io/gmane.comp.lang.ruby.rainbows.general diff --git a/Sandbox b/Sandbox index 63c44c4..538c792 100644 --- a/Sandbox +++ b/Sandbox @@ -1,6 +1,6 @@ = Tips for using \Rainbows! with Sandbox installation tools -Most {tips for unicorn}[https://bogomips.org/unicorn/Sandbox.html] +Most {tips for unicorn}[https://yhbt.net/unicorn/Sandbox.html] for Bundler and Isolate apply to \Rainbows! as well. == TLDR (Bundler) diff --git a/TUNING b/TUNING index 55a9ad4..7686624 100644 --- a/TUNING +++ b/TUNING @@ -1,6 +1,6 @@ = Tuning \Rainbows! -Most of the {tuning notes}[https://bogomips.org/unicorn/TUNING.html] +Most of the {tuning notes}[https://yhbt.net/unicorn/TUNING.html] apply to \Rainbows! as well. \Rainbows! is not particularly optimized at the moment and is designed for applications that spend large amounts of the time waiting on network activity. Thus memory usage and memory @@ -26,7 +26,7 @@ never be the primary goal of the project. the kernel. * If your workers do not seem to be releasing memory to the OS after - traffic spikes, consider the {mall}[https://bogomips.org/mall/] library + traffic spikes, consider the {mall}[https://yhbt.net/mall/] library which allows access to the mallopt(3) function from Ruby. As of October 2009 tcmalloc (the default allocator for Ruby Enterprise Edition) does not release memory back to the kernel, the best it can diff --git a/archive/rfmig.rb b/archive/rfmig.rb deleted file mode 100644 index a7d31e5..0000000 --- a/archive/rfmig.rb +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env ruby -require 'find' -require 'fileutils' -rfdir = 'rubyforge.org:/var/www/gforge-projects/rainbows/' -newbase = 'https://bogomips.org/rainbows/' -refresh = '<meta http-equiv="refresh" content="0; url=%s" />' -old = 'rf.old' -new = 'rf.new' -cmd = %W(rsync -av #{rfdir} #{old}/) -unless File.directory?(old) - system(*cmd) or abort "#{cmd.inspect} failed: #$?" -end - -Find.find(old) do |path| - path =~ /\.html\z/ or next - data = File.read(path) - tmp = path.split(%r{/}) - tmp.shift == old or abort "BUG" - dst = "#{new}/#{tmp.join('/')}" - - tmp[-1] = '' if tmp[-1] == "index.html" - url = "#{newbase}#{tmp.join('/')}" - meta = sprintf(refresh, url) - data.sub!(/(<head[^>]*>)/i, "#$1#{meta}") - data.sub!(/(<body[^>]*>)/i, - "#{$1}Redirecting to <a href=\"#{url}\">#{url}</a> ...<br/>") - FileUtils.mkdir_p(File.dirname(dst)) - File.open(dst, "w") { |fp| fp.write(data) } -end - -print "Verify results in #{new}/, then run:\n " -puts %W(rsync -av #{new}/ #{rfdir}).join(' ') diff --git a/archive/slrnpull.conf b/archive/slrnpull.conf index 9cf80ba..480cbec 100644 --- a/archive/slrnpull.conf +++ b/archive/slrnpull.conf @@ -1,4 +1,4 @@ # group_name max expire headers_only gmane.comp.lang.ruby.rainbows.general 1000000000 1000000000 0 -# usage: slrnpull -d $PWD -h news.gmane.org --no-post +# usage: slrnpull -d $PWD -h news.gmane.io --no-post diff --git a/examples/reverse_proxy.ru b/examples/reverse_proxy.ru index fcb9e74..432a37f 100644 --- a/examples/reverse_proxy.ru +++ b/examples/reverse_proxy.ru @@ -2,7 +2,7 @@ cfg = { :upstreams => [ "/tmp/.r.sock", - "http://bogomips.org/", + "http://yhbt.net/", [ "http://10.6.6.6:666/", { :weight => 666 } ], ] } diff --git a/lib/rainbows.rb b/lib/rainbows.rb index 584c94b..9d6d103 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -4,7 +4,7 @@ # the value passed to TCP_DEFER_ACCEPT actually matters in Linux 2.6.32+ Unicorn::SocketHelper::DEFAULTS[:tcp_defer_accept] = 60 -# See https://bogomips.org/rainbows/ for documentation +# See https://yhbt.net/rainbows/ for documentation module Rainbows # :stopdoc: O = {} diff --git a/lib/rainbows/configurator.rb b/lib/rainbows/configurator.rb index 83077cb..5eb7606 100644 --- a/lib/rainbows/configurator.rb +++ b/lib/rainbows/configurator.rb @@ -1,7 +1,7 @@ # -*- encoding: binary -*- # This module adds \Rainbows! to the -# {Unicorn::Configurator}[https://bogomips.org/unicorn/Unicorn/Configurator.html] +# {Unicorn::Configurator}[https://yhbt.net/unicorn/Unicorn/Configurator.html] # \Rainbows!-specific configuration options must be inside a the Rainbows! # block, otherwise Unicorn::Configurator directives may be used anywhere # in the file. @@ -9,7 +9,7 @@ # Warning: The "timeout" directive in unicorn is far more dangerous # in Rainbows!, since ALL requests running on a process will be lost # on worker death, not just one. Instead, handle application-level -# timeouts yourself: https://bogomips.org/unicorn/Application_Timeouts.html +# timeouts yourself: https://yhbt.net/unicorn/Application_Timeouts.html # # Rainbows! do # use :ThreadSpawn # concurrency model to use diff --git a/lib/rainbows/epoll.rb b/lib/rainbows/epoll.rb index 45c4d08..1e0c7a2 100644 --- a/lib/rainbows/epoll.rb +++ b/lib/rainbows/epoll.rb @@ -3,7 +3,7 @@ require 'sendfile' # Edge-triggered epoll concurrency model using -# {sleepy_penguin}[https://bogomips.org/sleepy_penguin/] for epoll. +# {sleepy_penguin}[https://yhbt.net/sleepy_penguin/] for epoll. # # Unlike more portable options like Coolio and EventMachine, this # is Linux-only, but uses edge-triggering instead of level-triggering, diff --git a/lib/rainbows/reverse_proxy.rb b/lib/rainbows/reverse_proxy.rb index a4d8390..f844c1d 100644 --- a/lib/rainbows/reverse_proxy.rb +++ b/lib/rainbows/reverse_proxy.rb @@ -3,7 +3,7 @@ require 'socket' require 'thread' require 'uri' -require 'kcar' # https://bogomips.org/kcar/ -- gem install kcar +require 'kcar' # https://yhbt.net/kcar/ -- gem install kcar # This is lightly tested and has an unstable configuration interface. # ***** Do not rely on anything under the ReverseProxy namespace! ***** diff --git a/rainbows.gemspec b/rainbows.gemspec index 259e2ab..558799e 100644 --- a/rainbows.gemspec +++ b/rainbows.gemspec @@ -8,13 +8,13 @@ s.authors = ['Rainbows! hackers'] s.description = File.read('README').split("\n\n")[1] - s.email = %q{rainbows-public@bogomips.org} + s.email = %q{rainbows-public@yhbt.net} s.executables = %w(rainbows) s.extra_rdoc_files = IO.readlines('.document').map!(&:chomp!).keep_if do |f| File.exist?(f) end s.files = manifest - s.homepage = 'https://bogomips.org/rainbows/' + s.homepage = 'https://yhbt.net/rainbows/' s.summary = 'Rack app server for sleepy apps and slow clients' # we want a newer Rack for a valid HeaderHash#each @@ -59,11 +59,11 @@ ruby_1_8 = 'Nonstandard' s.licenses = [ 'GPL-2.0+', ruby_1_8 ] s.metadata = { - 'bug_tracker_uri' => 'https://bogomips.org/rainbows/#label-Contact', - 'changelog_uri' => 'https://bogomips.org/rainbows/NEWS.html', - 'documentation_uri' => 'https://bogomips.org/rainbows/', - 'homepage_uri' => 'https://bogomips.org/rainbows/', - 'mailing_list_uri' => 'https://bogomips.org/rainbows-public/', - 'source_code_uri' => 'https://bogomips.org/rainbows.git', + 'bug_tracker_uri' => 'https://yhbt.net/rainbows/#label-Contact', + 'changelog_uri' => 'https://yhbt.net/rainbows/NEWS.html', + 'documentation_uri' => 'https://yhbt.net/rainbows/', + 'homepage_uri' => 'https://yhbt.net/rainbows/', + 'mailing_list_uri' => 'https://yhbt.net/rainbows-public/', + 'source_code_uri' => 'https://yhbt.net/rainbows.git', } end diff --git a/vs_Unicorn b/vs_Unicorn index 1ae2db3..88f08ff 100644 --- a/vs_Unicorn +++ b/vs_Unicorn @@ -82,7 +82,7 @@ unicorn code), some things are not: to different worker processes, and if your listen() +:backlog+ is overflowing: to other machines in your cluster. -* Accepts the same {signals}[https://bogomips.org/unicorn/SIGNALS.html] +* Accepts the same {signals}[https://yhbt.net/unicorn/SIGNALS.html] for process management, so you can share scripts to manage them (and nginx, too).
Mainly fixes some mismatched indentation warnings with Ruby 2.6+ Some doc updates, too. 4 changes since v5.1.1 (2017-04-02) quiet mismatched indentation warnings t/hijack.ru: avoid shadow warning t/test_isolate: various version updates various documentation updates Rainbows! is maintained as long as anybody uses it, but I don't recommend using it for new apps: https://bogomips.org/rainbows-public/20151020095934.GA19114@dcvr.yhbt.net/ * https://bogomips.org/rainbows/ * rainbows-public@bogomips.org * https://bogomips.org/rainbows-public/ * git clone https://bogomips.org/rainbows.git * https://bogomips.org/rainbows/NEWS.atom.xml * nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows * nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general
Point to HTTPS to discourage sniffable traffic. olddoc and pandoc are only necessary for packaging gems/updating-the-website, not development. Update some references to other projects. --- .olddoc.yml | 2 +- HACKING | 6 +++--- README | 20 ++++++++++---------- rainbows.gemspec | 33 ++++++++++++++++++++------------- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/.olddoc.yml b/.olddoc.yml index d9bb974..3e776ef 100644 --- a/.olddoc.yml +++ b/.olddoc.yml @@ -1,6 +1,6 @@ --- cgit_url: https://bogomips.org/rainbows.git -git_url: git://bogomips.org/rainbows.git +git_url: https://bogomips.org/rainbows.git rdoc_url: https://bogomips.org/rainbows/ merge_html: rainbows_1: Documentation/rainbows.1.html diff --git a/HACKING b/HACKING index 39a68ef..31f2111 100644 --- a/HACKING +++ b/HACKING @@ -44,12 +44,12 @@ Please Cc: everyone on replies, as not everyone is subscribed. == Building a Gem -In order to build the gem, you must install the following components: +In order to build the gem, you must install the following components +for documentation: - * olddoc (RubyGem) * pandoc -You can build the Unicorn gem with the following command: +You can build the Rainbows! gem with the following command: gmake gem diff --git a/README b/README index 027f58a..178990d 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -= Rainbows! - unicorn for sleepy apps and slow clients += Rainbows! - Rack app server for sleepy apps and slow clients \Rainbows! is an HTTP server for sleepy Rack applications. It is based on unicorn, but designed to handle applications that expect long @@ -51,7 +51,7 @@ network concurrency. * Designed for {Rack}[http://rack.github.io/], the standard for modern Ruby HTTP applications. -* Built on {Unicorn}[https://bogomips.org/unicorn/], inheriting its +* Built on {unicorn}[https://bogomips.org/unicorn/], inheriting its process/socket management features such as transparent upgrades and Ruby configuration DSL. @@ -81,7 +81,6 @@ network concurrency. * HTTP server push * Long polling * Reverse AJAX -* real-time upload processing (via {upr}[http://upr.bogomips.org/]) \Rainbows! can also be used to service slow clients directly even with fast applications. @@ -123,7 +122,7 @@ config file: worker_processes 4 # assuming four CPU cores Rainbows! do - use :FiberSpawn + use :ThreadSpawn worker_connections 100 end @@ -136,23 +135,24 @@ for more details. You can get the latest source via git from the following locations (these versions may not be stable): - git://bogomips.org/rainbows.git - git://repo.or.cz/rainbows.git (mirror) + https://bogomips.org/rainbows.git + https://repo.or.cz/rainbows.git (mirror) You may browse the code from the web and download the latest snapshot tarballs here: * https://bogomips.org/rainbows.git -* http://repo.or.cz/w/rainbows.git (gitweb) +* https://repo.or.cz/rainbows.git (gitweb) Inline patches (from "git format-patch") to the mailing list are preferred because they allow code review and comments in the reply to the patch. We will adhere to mostly the same conventions for patch submissions as -git itself. See the Documentation/SubmittingPatches document -distributed with git on on patch submission guidelines to follow. Just -don't email the git mailing list or maintainer with \Rainbows! patches. +git itself. See the +https://80x24.org/mirrors/git.git/tree/Documentation/SubmittingPatches?h=v2.20.1 +document distributed with git on on patch submission guidelines to follow. +Just don't email the git mailing list or maintainer with \Rainbows! patches. == Disclaimer diff --git a/rainbows.gemspec b/rainbows.gemspec index 4283a85..259e2ab 100644 --- a/rainbows.gemspec +++ b/rainbows.gemspec @@ -1,22 +1,21 @@ # -*- encoding: binary -*- -ENV["VERSION"] or abort "VERSION= must be specified" -manifest = File.readlines('.manifest').map! { |x| x.chomp! } -require 'olddoc' -extend Olddoc::Gemspec -name, summary, title = readme_metadata +manifest = File.exist?('.manifest') ? + IO.readlines('.manifest').map!(&:chomp!) : `git ls-files`.split("\n") Gem::Specification.new do |s| s.name = %q{rainbows} - s.version = ENV["VERSION"].dup + s.version = (ENV["VERSION"] || '5.1.1').dup - s.authors = ["#{name} hackers"] - s.description = readme_description + s.authors = ['Rainbows! hackers'] + s.description = File.read('README').split("\n\n")[1] s.email = %q{rainbows-public@bogomips.org} s.executables = %w(rainbows) - s.extra_rdoc_files = extra_rdoc_files(manifest) + s.extra_rdoc_files = IO.readlines('.document').map!(&:chomp!).keep_if do |f| + File.exist?(f) + end s.files = manifest - s.homepage = Olddoc.config['rdoc_url'] - s.summary = summary + s.homepage = 'https://bogomips.org/rainbows/' + s.summary = 'Rack app server for sleepy apps and slow clients' # we want a newer Rack for a valid HeaderHash#each s.add_dependency(%q<rack>, ['>= 1.1', '< 3.0']) @@ -29,7 +28,6 @@ s.add_dependency(%q<unicorn>, ["~> 5.1"]) s.add_development_dependency(%q<isolate>, "~> 3.1") - s.add_development_dependency(%q<olddoc>, "~> 1.2") # optional runtime dependencies depending on configuration # see t/test_isolate.rb for the exact versions we've tested with @@ -58,5 +56,14 @@ # We cannot automatically switch licenses when Ruby changes their license, # so we remain optionally-licensed under the terms of Ruby 1.8 despite # not having a good way to specify this in an SPDX-compatible way... - s.licenses = ['GPL-2.0+', 'Nonstandard'] # Nonstandard = 'Ruby 1.8' + ruby_1_8 = 'Nonstandard' + s.licenses = [ 'GPL-2.0+', ruby_1_8 ] + s.metadata = { + 'bug_tracker_uri' => 'https://bogomips.org/rainbows/#label-Contact', + 'changelog_uri' => 'https://bogomips.org/rainbows/NEWS.html', + 'documentation_uri' => 'https://bogomips.org/rainbows/', + 'homepage_uri' => 'https://bogomips.org/rainbows/', + 'mailing_list_uri' => 'https://bogomips.org/rainbows-public/', + 'source_code_uri' => 'https://bogomips.org/rainbows.git', + } end -- EW
--- t/test_isolate.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/test_isolate.rb b/t/test_isolate.rb index b1aaf13..b1aa5bb 100644 --- a/t/test_isolate.rb +++ b/t/test_isolate.rb @@ -16,11 +16,11 @@ lock = File.open(__FILE__, "rb") lock.flock(File::LOCK_EX) Isolate.now!(opts) do - gem 'kgio', '2.11.0' - gem 'rack', '2.0.1' + gem 'kgio', '2.11.2' + gem 'rack', '2.0.6' gem 'kcar', '0.6.0' - gem 'raindrops', '0.18.0' - gem 'unicorn', '5.3.0' + gem 'raindrops', '0.19.0' + gem 'unicorn', '5.4.1' if engine == "ruby" gem 'sendfile', '1.2.2' @@ -43,7 +43,7 @@ end if RUBY_PLATFORM =~ /linux/ - gem 'sleepy_penguin', '3.4.1' + gem 'sleepy_penguin', '3.5.1' # is 2.6.32 new enough? gem 'io_splice', '4.4.0' if `uname -r`.strip > '2.6.32' -- EW
Ruby trunk started warning about more mismatched indentations starting around r62836. --- lib/rainbows/app_pool.rb | 4 +-- lib/rainbows/base.rb | 4 +-- lib/rainbows/configurator.rb | 4 +-- lib/rainbows/coolio/client.rb | 8 +++--- lib/rainbows/coolio/thread_client.rb | 4 +-- lib/rainbows/epoll/client.rb | 30 ++++++++++---------- lib/rainbows/epoll/response_pipe.rb | 6 ++-- lib/rainbows/error.rb | 6 ++-- lib/rainbows/ev_core.rb | 8 +++--- lib/rainbows/fiber/body.rb | 4 +-- lib/rainbows/fiber/io.rb | 4 +-- lib/rainbows/http_server.rb | 8 +++--- lib/rainbows/process_client.rb | 4 +-- lib/rainbows/response.rb | 16 +++++------ lib/rainbows/revactor.rb | 4 +-- lib/rainbows/revactor/client/methods.rb | 4 +-- lib/rainbows/revactor/client/tee_socket.rb | 2 +- lib/rainbows/reverse_proxy/coolio.rb | 22 +++++++------- lib/rainbows/stream_response_epoll/client.rb | 6 ++-- lib/rainbows/thread_timeout.rb | 10 +++---- lib/rainbows/xepoll/client.rb | 4 +-- lib/rainbows/xepoll_thread_pool/client.rb | 8 +++--- lib/rainbows/xepoll_thread_spawn/client.rb | 8 +++--- t/bin/unused_listen | 2 +- t/hijack.ru | 4 +-- t/sha1-random-size.ru | 2 +- 26 files changed, 93 insertions(+), 93 deletions(-) diff --git a/lib/rainbows/app_pool.rb b/lib/rainbows/app_pool.rb index 44c6bf5..2d71604 100644 --- a/lib/rainbows/app_pool.rb +++ b/lib/rainbows/app_pool.rb @@ -97,7 +97,7 @@ def call(env) # :nodoc: app = pool.shift app.call(env) - ensure - pool << app + ensure + pool << app end end diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index a7ba17d..d0e7342 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -49,8 +49,8 @@ def reopen_worker_logs(worker_nr) logger.info "worker=#{worker_nr} reopening logs..." Unicorn::Util.reopen_logs logger.info "worker=#{worker_nr} done reopening logs" - rescue - Rainbows.quit! # let the master reopen and refork us + rescue + Rainbows.quit! # let the master reopen and refork us end # :startdoc: end diff --git a/lib/rainbows/configurator.rb b/lib/rainbows/configurator.rb index d82002e..83077cb 100644 --- a/lib/rainbows/configurator.rb +++ b/lib/rainbows/configurator.rb @@ -46,8 +46,8 @@ def Rainbows!(&block) block_given? or raise ArgumentError, "Rainbows! requires a block" @block = true instance_eval(&block) - ensure - @block = false + ensure + @block = false end def check! # :nodoc: diff --git a/lib/rainbows/coolio/client.rb b/lib/rainbows/coolio/client.rb index cd22c22..12c1434 100644 --- a/lib/rainbows/coolio/client.rb +++ b/lib/rainbows/coolio/client.rb @@ -160,8 +160,8 @@ def on_write_complete on_read(''.freeze) end end - rescue => e - handle_error(e) + rescue => e + handle_error(e) end def handle_error(e) @@ -170,8 +170,8 @@ def handle_error(e) @_io.kgio_trywrite(msg) rescue nil end @_write_buffer.clear - ensure - quit + ensure + quit end def close_deferred diff --git a/lib/rainbows/coolio/thread_client.rb b/lib/rainbows/coolio/thread_client.rb index a3a2ebf..e977381 100644 --- a/lib/rainbows/coolio/thread_client.rb +++ b/lib/rainbows/coolio/thread_client.rb @@ -16,8 +16,8 @@ def app_call input def response_write(response) return hijacked if @hp.hijacked? ev_write_response(*response, @hp.next?) - rescue => e - handle_error(e) + rescue => e + handle_error(e) end # fails-safe application dispatch, we absolutely cannot diff --git a/lib/rainbows/epoll/client.rb b/lib/rainbows/epoll/client.rb index 85e504c..6ed141e 100644 --- a/lib/rainbows/epoll/client.rb +++ b/lib/rainbows/epoll/client.rb @@ -39,8 +39,8 @@ def epoll_once @wr_queue = [] # may contain String, ResponsePipe, and StreamFile objects post_init on_readable - rescue => e - handle_error(e) + rescue => e + handle_error(e) end def on_readable @@ -56,9 +56,9 @@ def on_readable break end until :close == @state close unless closed? - rescue Errno::ECONNRESET - close - rescue IOError + rescue Errno::ECONNRESET + close + rescue IOError end def app_call input # called by on_read() @@ -146,8 +146,8 @@ def on_deferred_write_complete def handle_error(e) msg = Rainbows::Error.response(e) and kgio_trywrite(msg) rescue nil - ensure - close + ensure + close end def write_deferred(obj) @@ -171,8 +171,8 @@ def on_writable when :deferred return end while true - rescue => e - handle_error(e) + rescue => e + handle_error(e) end def write(buf) @@ -227,9 +227,9 @@ def stream_file(sf) # +sf+ is a Rainbows::StreamFile object else return n # :wait_writable or nil end while true - rescue - sf.close - raise + rescue + sf.close + raise end def defer_file_stream(offset, count, io, body) @@ -263,8 +263,8 @@ def stream_pipe(pipe) else # nil => EOF return pipe.close # nil end while true - rescue - pipe.close - raise + rescue + pipe.close + raise end end diff --git a/lib/rainbows/epoll/response_pipe.rb b/lib/rainbows/epoll/response_pipe.rb index 64b1547..87b2818 100644 --- a/lib/rainbows/epoll/response_pipe.rb +++ b/lib/rainbows/epoll/response_pipe.rb @@ -14,9 +14,9 @@ def initialize(io, client, body) def epoll_run return close if @client.closed? @client.stream_pipe(self) or @client.on_deferred_write_complete - rescue => e - close - @client.handle_error(e) + rescue => e + close + @client.handle_error(e) end def close diff --git a/lib/rainbows/error.rb b/lib/rainbows/error.rb index 3686eab..57c9173 100644 --- a/lib/rainbows/error.rb +++ b/lib/rainbows/error.rb @@ -8,18 +8,18 @@ module Rainbows::Error # the socket is closed at the end of this function def self.write(io, e) msg = response(e) and Kgio.trywrite(io, msg) - rescue + rescue end def self.app(e) Unicorn.log_error(Rainbows.server.logger, "app error", e) - rescue + rescue end def self.listen_loop(e) Rainbows.alive or return Unicorn.log_error(Rainbows.server.logger, "listen loop error", e) - rescue + rescue end def self.response(e) diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb index fd33786..0537f6f 100644 --- a/lib/rainbows/ev_core.rb +++ b/lib/rainbows/ev_core.rb @@ -43,8 +43,8 @@ def want_more def handle_error(e) msg = Rainbows::Error.response(e) and write(msg) - ensure - quit + ensure + quit end # returns whether to enable response chunking for autochunk models @@ -119,8 +119,8 @@ def on_read(data) want_more end end - rescue => e - handle_error(e) + rescue => e + handle_error(e) end def err_413(msg) diff --git a/lib/rainbows/fiber/body.rb b/lib/rainbows/fiber/body.rb index 5b2c74b..d9e925f 100644 --- a/lib/rainbows/fiber/body.rb +++ b/lib/rainbows/fiber/body.rb @@ -19,8 +19,8 @@ def write_body_file(body, range) else # nil return end while true - ensure - close_if_private(body) + ensure + close_if_private(body) end end diff --git a/lib/rainbows/fiber/io.rb b/lib/rainbows/fiber/io.rb index 111132f..dcd8c14 100644 --- a/lib/rainbows/fiber/io.rb +++ b/lib/rainbows/fiber/io.rb @@ -37,8 +37,8 @@ def each buf = readpartial(16384) yield buf yield buf while readpartial(16384, buf) - rescue EOFError - self + rescue EOFError + self end def closed? diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index 33bb96c..e925d80 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -71,10 +71,10 @@ def trysetrlimit(resource, want) @logger.warn "#{svc} may monopolize resources dictated by #{resource}" \ " and leave none for your app" end - rescue => e - @logger.error e.message - @logger.error "#{resource} needs to be increased to >=#{want} before" \ - " starting #{svc}" + rescue => e + @logger.error e.message + @logger.error "#{resource} needs to be increased to >=#{want} before" \ + " starting #{svc}" end def svc diff --git a/lib/rainbows/process_client.rb b/lib/rainbows/process_client.rb index 4bf9878..b500b75 100644 --- a/lib/rainbows/process_client.rb +++ b/lib/rainbows/process_client.rb @@ -83,8 +83,8 @@ def process_pipeline(env, hp) write_response(status, headers, body, alive = hp.next?) or return end while alive && pipeline_ready(hp) alive or close - rescue => e - handle_error(e) + rescue => e + handle_error(e) end # override this in subclass/module diff --git a/lib/rainbows/response.rb b/lib/rainbows/response.rb index 62dfa39..a76821f 100644 --- a/lib/rainbows/response.rb +++ b/lib/rainbows/response.rb @@ -91,8 +91,8 @@ def write_response(status, headers, body, alive) body = write_headers(status, headers, alive, body) write_body_each(body) if body body - ensure - body.close if body.respond_to?(:close) + ensure + body.close if body.respond_to?(:close) end end include Each @@ -102,8 +102,8 @@ module Sendfile def write_body_file(body, range) io = body_to_io(body) range ? sendfile(io, range[0], range[1]) : sendfile(io, 0) - ensure - close_if_private(io) + ensure + close_if_private(io) end end include Sendfile @@ -129,8 +129,8 @@ def write_body_file(body, range) # isn't used or available. def write_body_stream(body) COPY_STREAM.copy_stream(io = body_to_io(body), self) - ensure - close_if_private(io) + ensure + close_if_private(io) end else # ! COPY_STREAM alias write_body_stream write_body_each @@ -199,8 +199,8 @@ def write_response_path(status, headers, body, alive) write_body_stream(body) if body end body - ensure - body.close if body.respond_to?(:close) + ensure + body.close if body.respond_to?(:close) end module ToPath diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb index fae5f16..69a791c 100644 --- a/lib/rainbows/revactor.rb +++ b/lib/rainbows/revactor.rb @@ -75,8 +75,8 @@ def worker_loop(worker) #:nodoc: end Actor.sleep 1 while Rainbows.tick || nr > 0 - rescue Errno::EMFILE - # ignore, let another worker process take it + rescue Errno::EMFILE + # ignore, let another worker process take it end def revactorize_listeners #:nodoc: diff --git a/lib/rainbows/revactor/client/methods.rb b/lib/rainbows/revactor/client/methods.rb index 592c996..defb23a 100644 --- a/lib/rainbows/revactor/client/methods.rb +++ b/lib/rainbows/revactor/client/methods.rb @@ -26,8 +26,8 @@ def write_body_file(body, range) else # nil return end while true - ensure - close_if_private(body) + ensure + close_if_private(body) end end diff --git a/lib/rainbows/revactor/client/tee_socket.rb b/lib/rainbows/revactor/client/tee_socket.rb index 2f9f52e..31b8dec 100644 --- a/lib/rainbows/revactor/client/tee_socket.rb +++ b/lib/rainbows/revactor/client/tee_socket.rb @@ -34,7 +34,7 @@ def kgio_read(length, dst = "") # ugh, read returned too much @rbuf << tmp[length, tmp.size] dst.replace(tmp[0, length]) - rescue EOFError + rescue EOFError end # just proxy any remaining methods TeeInput may use diff --git a/lib/rainbows/reverse_proxy/coolio.rb b/lib/rainbows/reverse_proxy/coolio.rb index 86f2b79..e3b33b5 100644 --- a/lib/rainbows/reverse_proxy/coolio.rb +++ b/lib/rainbows/reverse_proxy/coolio.rb @@ -36,17 +36,17 @@ def on_readable return close end while true # we always read until EAGAIN or EOF - rescue => e - case e - when Errno::ECONNRESET - @env['async.callback'].call(@response) - return close - when SystemCallError - else - Unicorn.log_error(@env["rack.logger"], "on_readable", e) - end - @env['async.callback'].call(Rainbows::ReverseProxy::E502) - close + rescue => e + case e + when Errno::ECONNRESET + @env['async.callback'].call(@response) + return close + when SystemCallError + else + Unicorn.log_error(@env["rack.logger"], "on_readable", e) + end + @env['async.callback'].call(Rainbows::ReverseProxy::E502) + close end end diff --git a/lib/rainbows/stream_response_epoll/client.rb b/lib/rainbows/stream_response_epoll/client.rb index dc226d6..b757469 100644 --- a/lib/rainbows/stream_response_epoll/client.rb +++ b/lib/rainbows/stream_response_epoll/client.rb @@ -47,9 +47,9 @@ def epoll_run when :wait_writable return @wr_queue.unshift(buf) end while true - rescue => err - @to_io.close - N.decr(0, 1) + rescue + @to_io.close + N.decr(0, 1) end def on_write_complete diff --git a/lib/rainbows/thread_timeout.rb b/lib/rainbows/thread_timeout.rb index 8739d29..bea1631 100644 --- a/lib/rainbows/thread_timeout.rb +++ b/lib/rainbows/thread_timeout.rb @@ -134,11 +134,11 @@ def call(env) @lock.synchronize { @active.delete(Thread.current) } # Thread#raise no longer possible here end - rescue ExecutionExpired - # If we got here, it's because the watchdog thread raised an exception - # here to kill us. The watchdog uses @active.delete_if with a lock, - # so we guaranteed it's - [ 408, { 'Content-Type' => 'text/plain', 'Content-Length' => '0' }, [] ] + rescue ExecutionExpired + # If we got here, it's because the watchdog thread raised an exception + # here to kill us. The watchdog uses @active.delete_if with a lock, + # so we guaranteed it's + [ 408, { 'Content-Type' => 'text/plain', 'Content-Length' => '0' }, [] ] end # The watchdog thread is the one that does the job of killing threads diff --git a/lib/rainbows/xepoll/client.rb b/lib/rainbows/xepoll/client.rb index f518db5..748b4af 100644 --- a/lib/rainbows/xepoll/client.rb +++ b/lib/rainbows/xepoll/client.rb @@ -40,8 +40,8 @@ def epoll_once @wr_queue = [] # may contain String, ResponsePipe, and StreamFile objects post_init EP.set(self, IN) # wake up the main thread - rescue => e - Rainbows::Error.write(self, e) + rescue => e + Rainbows::Error.write(self, e) end def on_close diff --git a/lib/rainbows/xepoll_thread_pool/client.rb b/lib/rainbows/xepoll_thread_pool/client.rb index ca62727..810d992 100644 --- a/lib/rainbows/xepoll_thread_pool/client.rb +++ b/lib/rainbows/xepoll_thread_pool/client.rb @@ -95,8 +95,8 @@ def close def handle_error(e) super - ensure - closed? or close + ensure + closed? or close end def queue! @@ -114,8 +114,8 @@ def epoll_run(buf) else return close end while true - rescue => e - handle_error(e) + rescue => e + handle_error(e) end def run diff --git a/lib/rainbows/xepoll_thread_spawn/client.rb b/lib/rainbows/xepoll_thread_spawn/client.rb index 218db3e..8eebbb0 100644 --- a/lib/rainbows/xepoll_thread_spawn/client.rb +++ b/lib/rainbows/xepoll_thread_spawn/client.rb @@ -84,8 +84,8 @@ def close def handle_error(e) super - ensure - closed? or close + ensure + closed? or close end def epoll_run(buf) @@ -98,8 +98,8 @@ def epoll_run(buf) else return close end while true - rescue => e - handle_error(e) + rescue => e + handle_error(e) end def spawn(env, hp) diff --git a/t/bin/unused_listen b/t/bin/unused_listen index b638f54..8cce645 100755 --- a/t/bin/unused_listen +++ b/t/bin/unused_listen @@ -31,7 +31,7 @@ begin # when running tests in parallel with gmake. Create a lock file while # we have the port here to ensure that does not happen. lock_path = "#{Dir::tmpdir}/unicorn_test.#{addr}:#{port}.lock" - lock = File.open(lock_path, File::WRONLY|File::CREAT|File::EXCL, 0600) + File.open(lock_path, File::WRONLY|File::CREAT|File::EXCL, 0600) rescue Errno::EEXIST sock.close rescue nil retry diff --git a/t/hijack.ru b/t/hijack.ru index 64c23d7..16b5f38 100644 --- a/t/hijack.ru +++ b/t/hijack.ru @@ -45,9 +45,9 @@ def lazy_close(io) [ 200, { "Content-Length" => r.bytesize.to_s, - "rack.hijack" => proc do |io| + "rack.hijack" => proc do |sock| io.write(r) - lazy_close(io) + lazy_close(sock) end }, DieIfUsed.new diff --git a/t/sha1-random-size.ru b/t/sha1-random-size.ru index 4ef5d7b..9251221 100644 --- a/t/sha1-random-size.ru +++ b/t/sha1-random-size.ru @@ -18,7 +18,7 @@ end while input.read(rand(cap), buf) end when "/each" - input.each { |buf| digest.update(buf) } + input.each { |chunk| digest.update(chunk) } else if buf = input.read(rand(cap)) begin -- EW
--- t/hijack.ru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/hijack.ru b/t/hijack.ru index 16b5f38..f02507f 100644 --- a/t/hijack.ru +++ b/t/hijack.ru @@ -46,7 +46,7 @@ def lazy_close(io) { "Content-Length" => r.bytesize.to_s, "rack.hijack" => proc do |sock| - io.write(r) + sock.write(r) lazy_close(sock) end }, -- EW
Ruby 2.6 started warning on mismatched indentation, so fix that... Eric Wong (3): quiet mismatched indentation warnings t/hijack.ru: avoid shadow warning t/test_isolate: various version updates lib/rainbows/app_pool.rb | 4 +-- lib/rainbows/base.rb | 4 +-- lib/rainbows/configurator.rb | 4 +-- lib/rainbows/coolio/client.rb | 8 +++--- lib/rainbows/coolio/thread_client.rb | 4 +-- lib/rainbows/epoll/client.rb | 30 ++++++++++---------- lib/rainbows/epoll/response_pipe.rb | 6 ++-- lib/rainbows/error.rb | 6 ++-- lib/rainbows/ev_core.rb | 8 +++--- lib/rainbows/fiber/body.rb | 4 +-- lib/rainbows/fiber/io.rb | 4 +-- lib/rainbows/http_server.rb | 8 +++--- lib/rainbows/process_client.rb | 4 +-- lib/rainbows/response.rb | 16 +++++------ lib/rainbows/revactor.rb | 4 +-- lib/rainbows/revactor/client/methods.rb | 4 +-- lib/rainbows/revactor/client/tee_socket.rb | 2 +- lib/rainbows/reverse_proxy/coolio.rb | 22 +++++++------- lib/rainbows/stream_response_epoll/client.rb | 6 ++-- lib/rainbows/thread_timeout.rb | 10 +++---- lib/rainbows/xepoll/client.rb | 4 +-- lib/rainbows/xepoll_thread_pool/client.rb | 8 +++--- lib/rainbows/xepoll_thread_spawn/client.rb | 8 +++--- t/bin/unused_listen | 2 +- t/hijack.ru | 6 ++-- t/sha1-random-size.ru | 2 +- t/test_isolate.rb | 10 +++---- 27 files changed, 99 insertions(+), 99 deletions(-) -- EW
Might try some experiments on it, soon, using non-blocking accept (which means no migration/parallel-running with yahns) There could be a flood of patch emails coming, soon...
This is a legacy project, do not use it for new projects. Ruby 2.3 and later should make this obsolete. kgio provides non-blocking I/O methods for Ruby without raising exceptions on EAGAIN and EINPROGRESS. Note: I do not recommend using kgio for future applications, Ruby 2.x has a lot of the functionality of kgio and Ruby 2.3+ has even more. * homepage: https://bogomips.org/kgio/ * public mailing list: kgio-public@bogomips.org * git clone git://bogomips.org/kgio.git * Atom feed https://bogomips.org/kgio/NEWS.atom.xml * mailing list archives: https://bogomips.org/kgio-public/ Changes: kgio 2.11.2 - fix Ruby 2.5 compatibility for accept_class This release fixes a bug affecting the Rainbows! web server which uses Kgio.accept_class: https://bogomips.org/rainbows-public/CANp6QoJXRbPLqmOPpG7XmZBc+oYqLWCcq1ipvOyNEQPXDEwx9Q@mail.gmail.com/ * accept: avoid passing unnecessary arg to rb_funcall Again, using kgio for new projects is strongly discouraged. Use Ruby 2.3+ instead.
Claudio Poli <masterkain@gmail.com> wrote:
> hello Eric,
> I can confirm the bugs goes away with this version
Thanks for confirming.
Btw, please don't send HTML mail in the future since it's
spammy and too expensive to archive. Thanks again.
kain <masterkain@gmail.com> wrote: > hello Eric, > I tried upgrading ruby to 2.5.0 from 2.3.4 on our big project, I have this > issue on rainbows if you would like to look into: > > E, [2018-01-19T16:17:56.595280 #76399] ERROR -- : wrong number of arguments > (given 16, expected 0) (ArgumentError) Ah, this might be a bug in kgio with clang and 2.5. The following patch should fix it: https://bogomips.org/kgio-public/20180119170307.19295-1-e@80x24.org/raw and I've uploaded kgio 2.11.1.1.g36ea to Rubygems.org. Can you try it and give it a shot? gem install --pre kgio -v 2.11.1.1.g36ea I'll make a real kgio release with your confirmation. Thanks > /Users/kain/.rvm/gems/ruby-2.5.0/gems/rainbows-5.1.1/lib/rainbows/response.rb:13:in > `included_modules' > > /Users/kain/.rvm/gems/ruby-2.5.0/gems/rainbows-5.1.1/lib/rainbows/response.rb:13:in > `accept_class='
For anybody who's reading this through a mailing list subscription, it turns out I screwed up setting the List-Id: header back in 2014 and didn't read RFC 2919 :x https://public-inbox.org/meta/20170626030733.6069-1-e@80x24.org/ Before: List-Id: <rainbows-public@bogomips.org> After: List-Id: <rainbows-public.bogomips.org> So if you rely on the List-Id header, for filtering (as you should, actually); I suggest updating your filters. Thanks. I'm also setting "Precedence: bulk" which may help deliverability with certain large email providers. Of course, those of you reading this inbox via HTTPS / NNTP, or the Tor .onions; you can ignore this message :) https://bogomips.org/rainbows-public/ http://ou63pmih66umazou.onion/rainbows-public nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows HAND.
Thanks Eric,
sorry I had didn’t have a chance to test the patch, but I installed the new release and everything seems fine.
Rainbows! best web server out there.
Best,
c
> On 2 Apr 2017, at 02:32, Eric Wong <e@80x24.org> wrote:
>
> Eric Wong <e@80x24.org> wrote:
>> the report. Can you give the following a try?
>
> Nm, better patch coming.
Rainbows! 5.1.1 This release fixes an incompatibility introduced with the release of unicorn 5.3.0, yesterday :x. Thanks to Claudio Poli for reporting the bug (and reminding me this project exists). Two changes since 5.1.0 (2017-01-12): workaround for unicorn 5.3.0 tests: update isolate deps for unicorn and raindrops Rainbows! is maintained as long as anybody uses it, but I don't recommend using it for new apps: https://bogomips.org/rainbows-public/20151020095934.GA19114@dcvr.yhbt.net/ * https://bogomips.org/rainbows/ * rainbows-public@bogomips.org * https://bogomips.org/rainbows-public/ * git clone git://bogomips.org/rainbows.git * https://bogomips.org/rainbows/NEWS.atom.xml * nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows * nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general
unicorn 5.3.0 introduced a new Unicorn::TCPSrv and Unicorn::TCPClient constants to distinguish TCP sockets from Unix ones from its check_client_connection feature. These classes screw up our direct inheritance of Kgio::Socket from the Rainbows::Client class. Since we do not support check_client_connection, we do not need these new classes in unicorn. Removing Unicorn::TCPSrv and aliasing it as Kgio::TCPServer is sufficient for now. In the future, removing all kgio dependencies from Rainbows! will be prioritized. Thanks to Claudio Poli for reporting the bug: https://bogomips.org/rainbows-public/9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com/ --- This patch passes all tests, expect a release coming ASAP. Thanks again. lib/rainbows.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/rainbows.rb b/lib/rainbows.rb index acfe911..584c94b 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -149,3 +149,12 @@ def self.now # Ruby <= 2.0 require 'rainbows/error' require 'rainbows/configurator' + +module Unicorn + # this interferes with Rainbows::Client creation with unicorn 5.3 + begin + remove_const :TCPSrv + TCPSrv = Kgio::TCPServer + rescue NameError # unicorn < 5.3.0 + end +end -- EW
Eric Wong <e@80x24.org> wrote:
> the report. Can you give the following a try?
Nm, better patch coming.
Claudio Poli <masterkain@gmail.com> wrote: > hello, > I’m using Rainbows! 5.1.0 and I did a bundle update, unicorn got upgraded from 5.2.0 to 5.3.0 and I’m getting this: > Oops! I totally forget about this project, again. Thanks for the report. Can you give the following a try? Should be compatible with all unicorn 5.1+. (It'll take me a while to test on my Centrino laptop) diff --git a/lib/rainbows/coolio/server.rb b/lib/rainbows/coolio/server.rb index 0d8af8c..a24d65e 100644 --- a/lib/rainbows/coolio/server.rb +++ b/lib/rainbows/coolio/server.rb @@ -6,6 +6,6 @@ class Rainbows::Coolio::Server < Coolio::IO def on_readable return if CONN.size >= MAX - io = @_io.kgio_tryaccept and CL.new(io).attach(LOOP) + io = @_io.kgio_tryaccept(Rainbows::Client) and CL.new(io).attach(LOOP) end end diff --git a/lib/rainbows/epoll/server.rb b/lib/rainbows/epoll/server.rb index ab5a49f..daa6df3 100644 --- a/lib/rainbows/epoll/server.rb +++ b/lib/rainbows/epoll/server.rb @@ -23,7 +23,7 @@ def self.extended(sock) def epoll_run return EP.delete(self) if @@nr >= MAX - while io = kgio_tryaccept + while io = kgio_tryaccept(Rainbows::Client) @@nr += 1 # there's a chance the client never even sees epoll for simple apps io.epoll_once diff --git a/lib/rainbows/fiber/coolio/server.rb b/lib/rainbows/fiber/coolio/server.rb index 3d8d85e..51c4054 100644 --- a/lib/rainbows/fiber/coolio/server.rb +++ b/lib/rainbows/fiber/coolio/server.rb @@ -17,7 +17,7 @@ def close def on_readable return if Rainbows.cur >= MAX - c = @io.kgio_tryaccept and Fiber.new { process(c) }.resume + c = @io.kgio_tryaccept(Rainbows::Client) and Fiber.new { process(c) }.resume end def process(io) diff --git a/lib/rainbows/fiber_spawn.rb b/lib/rainbows/fiber_spawn.rb index 2c6d13d..3f0ec4a 100644 --- a/lib/rainbows/fiber_spawn.rb +++ b/lib/rainbows/fiber_spawn.rb @@ -23,7 +23,7 @@ def worker_loop(worker) # :nodoc: begin schedule do |l| break if Rainbows.cur >= limit - io = l.kgio_tryaccept or next + io = l.kgio_tryaccept(Rainbows::Client) or next Fiber.new { process(io) }.resume end rescue => e diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb index 63d57cb..04305ed 100644 --- a/lib/rainbows/thread_pool.rb +++ b/lib/rainbows/thread_pool.rb @@ -38,7 +38,7 @@ def worker_loop(worker) # :nodoc: def sync_worker # :nodoc: s = LISTENERS[0] begin - c = s.kgio_accept and c.process_loop + c = s.kgio_accept(Rainbows::Client) and c.process_loop rescue => e Rainbows::Error.listen_loop(e) end while Rainbows.alive @@ -52,7 +52,7 @@ def async_worker # :nodoc: # problem. On the other hand, a thundering herd may not # even incur as much overhead as an extra Mutex#synchronize ret = select(LISTENERS) and ret[0].each do |s| - s = s.kgio_tryaccept and s.process_loop + s = s.kgio_tryaccept(Rainbows::Client) and s.process_loop end rescue Errno::EINTR rescue => e diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index b304688..8ea75bf 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -29,7 +29,7 @@ def accept_loop(klass) #:nodoc: begin if lock.synchronize { nr >= limit } worker_yield - elsif client = l.kgio_accept + elsif client = l.kgio_accept(Rainbows::Client) klass.new(client) do |c| begin lock.synchronize { nr += 1 }
hello, I’m using Rainbows! 5.1.0 and I did a bundle update, unicorn got upgraded from 5.2.0 to 5.3.0 and I’m getting this: 02:02:27 web.1 | E, [2017-04-02T02:02:27.407688 #23360] ERROR -- : listen loop error: undefined method `process_loop' for #<Unicorn::TCPClient:fd 14> (NoMethodError) 02:02:27 web.1 | E, [2017-04-02T02:02:27.407805 #23360] ERROR -- : /Users/kain/.rvm/gems/ruby-2.4.1/gems/rainbows-5.1.0/lib/rainbows/thread_pool.rb:55:in `block in async_worker' 02:02:27 web.1 | E, [2017-04-02T02:02:27.407855 #23360] ERROR -- : /Users/kain/.rvm/gems/ruby-2.4.1/gems/rainbows-5.1.0/lib/rainbows/thread_pool.rb:54:in `each' 02:02:27 web.1 | E, [2017-04-02T02:02:27.407899 #23360] ERROR -- : /Users/kain/.rvm/gems/ruby-2.4.1/gems/rainbows-5.1.0/lib/rainbows/thread_pool.rb:54:in `async_worker' 02:02:27 web.1 | E, [2017-04-02T02:02:27.407939 #23360] ERROR -- : /Users/kain/.rvm/gems/ruby-2.4.1/gems/rainbows-5.1.0/lib/rainbows/thread_pool.rb:25:in `block (2 levels) in worker_loop' thanks, c
Hi Eric, Sorry it took me that long to test this but I finally finished the migration and deployed the app in staging (we don't use rainbows in development mode) and after a quick click testing everything works as expected with the latest release 5.1.0. Thanks again for your support!
This release now supports rack 2.x along with existing rack 1.x applications. Additionally, we now wait for deferred actions for EventMachine users on graceful shutdown. Thanks to Julia López Aladro and <alex0375@gmail.com> for bringing up these changes in the open-to-all rainbows-public@bogomips.org mailing list: https://bogomips.org/rainbows-public/CAPhSs6OAU+motd+MF=WOSek9==StLjEQJsNwAO3-aRWCZzhs=g@mail.gmail.com/T/ https://bogomips.org/rainbows-public/CAKwvcL-VH3we4qA1pkNAstTmWvqNA=Rir2N_YiWztV_qbaLQvA@mail.gmail.com/T/ There's also a few documentation and test fixes. 9 changes since Rainbows! 5.0.0: doc: bump olddoc to ~> 1.2 for extra NNTP URLs doc: move homepage and update URLs to HTTPS doc: Static_Files: remove Future section tests: use correct file:// URL for random_blob path support rack 2.x Revert "t/t0044-autopush.sh: remove test" tests: re-enable EventMachine tests, again eventmachine: wait for deferred actions to finish doc: additional disclaimers Rainbows! is maintained as long as anybody uses it, but I don't recommend using it for new apps: https://bogomips.org/rainbows-public/20151020095934.GA19114@dcvr.yhbt.net/ * https://bogomips.org/rainbows/ * rainbows-public@bogomips.org * https://bogomips.org/rainbows-public/ * git clone git://bogomips.org/rainbows.git * https://bogomips.org/rainbows/NEWS.atom.xml * nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows * nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general *zzz*
Honestly, these disclaimers should've been there all along; and should apply to all servers handling multiple clients within a single process. --- README | 9 +++++++++ lib/rainbows/configurator.rb | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/README b/README index ac10375..027f58a 100644 --- a/README +++ b/README @@ -159,6 +159,15 @@ don't email the git mailing list or maintainer with \Rainbows! patches. There is NO WARRANTY whatsoever if anything goes wrong, but let us know and we'll try our best to fix it. +Rainbows! is extremely sensitive to fatal bugs in the apps it hosts. +Each Rainbows! worker process may be handling thousands of clients; +unexpectedly killing the process will abort _all_ of those +connections. Lives may be lost! + +Rainbows! hackers are not responsible for your application/library bugs. +Use an application server which is tolerant of buggy applications +if you cannot be bothered to fix all your fatal bugs. + == Contact All feedback (bug reports, user/development discussion, patches, pull diff --git a/lib/rainbows/configurator.rb b/lib/rainbows/configurator.rb index 10cb60d..d82002e 100644 --- a/lib/rainbows/configurator.rb +++ b/lib/rainbows/configurator.rb @@ -6,6 +6,11 @@ # block, otherwise Unicorn::Configurator directives may be used anywhere # in the file. # +# Warning: The "timeout" directive in unicorn is far more dangerous +# in Rainbows!, since ALL requests running on a process will be lost +# on worker death, not just one. Instead, handle application-level +# timeouts yourself: https://bogomips.org/unicorn/Application_Timeouts.html +# # Rainbows! do # use :ThreadSpawn # concurrency model to use # worker_connections 400 -- EW
Hi, Eric
I have tried the new revision (rainbows-5.0.0.8.gf385) and it works
great for me.
Thanks!
On Mon, Jan 9, 2017 at 10:43 PM, Eric Wong <e@80x24.org> wrote:
> alex0375@gmail.com wrote:
>> Am I missing something? Can this be a part of Rainbows?
>
> Nope, you're not missing anything :)
> Rainbows! was missing an EM feature introduced in 2012 :x
>
> I'll make a 5.1.0 release with following patches
> (coming in-reply-to this email) soon.
>
> There's also rack 2.x compatibility sitting in rainbows.git.
> https://bogomips.org/rainbows-public/20161117033531.GA4454@dcvr/T/
>
> The following changes since commit bd7596e50bd094edf5e5842afb8239c158fe2491:
>
> Revert "t/t0044-autopush.sh: remove test" (2016-12-24 21:42:06 +0000)
>
> are available in the git repository at:
>
> git://bogomips.org/rainbows em-deferred
>
> for you to fetch changes up to f385ed423e11ad40822f688bc592eaa78efa5b34:
>
> eventmachine: wait for deferred actions to finish (2017-01-09 18:59:00 +0000)
>
> ----------------------------------------------------------------
> Eric Wong (2):
> tests: re-enable EventMachine tests, again
> eventmachine: wait for deferred actions to finish
>
> SIGNALS | 6 +++---
> lib/rainbows/event_machine.rb | 10 +++++++++-
> t/GNUmakefile | 2 +-
> t/app_deferred.ru | 8 +++++++-
> t/t0700-app-deferred.sh | 18 +++++++++++++++---
> 5 files changed, 35 insertions(+), 9 deletions(-)
Julia López Aladro <julialopez@gmail.com> wrote:
> PS: Sorry about the late response!
Hey, just wondering if you've had a chance to run with rack 2.x
support in rainbows. Anyways I took an extra look at the
changes and it seems fine. I'll probably release 5.1.0 final
in a day or two now that holidays are over and there's some
improvements ready to drop into 'master'.
Thanks.
Since EventMachine 1.0.0 in 2012, the EM.defers_finish? API exists to check for the existence of deferred actions. Support it if it exists in the running version of EM and update the note in our SIGNALS document. Thanks to <alex0375@gmail.com> on the mailing list for bringing this up: https://bogomips.org/rainbows-public/CAKwvcL-VH3we4qA1pkNAstTmWvqNA=Rir2N_YiWztV_qbaLQvA@mail.gmail.com/ --- SIGNALS | 6 +++--- lib/rainbows/event_machine.rb | 10 +++++++++- t/app_deferred.ru | 8 +++++++- t/t0700-app-deferred.sh | 18 +++++++++++++++--- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/SIGNALS b/SIGNALS index e53c3e4..fa95a1c 100644 --- a/SIGNALS +++ b/SIGNALS @@ -24,9 +24,9 @@ between \Rainbows!, unicorn and nginx. * INT/TERM - quick shutdown, kills all workers immediately * QUIT - graceful shutdown, waits for workers to finish their - current request before finishing. This currently does not - wait for requests deferred to a separate thread when using - EventMachine (when app.deferred?(env) => true) + current request before finishing. Since Rainbows 5.1.0 (Jan 2017), + this waits requests deferred to a separate thread with + EventMachine (app.deferred?(env) => true). * USR1 - reopen all logs owned by the master and all workers See Unicorn::Util.reopen_logs for what is considered a log. diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb index b326e26..896fdac 100644 --- a/lib/rainbows/event_machine.rb +++ b/lib/rainbows/event_machine.rb @@ -65,6 +65,11 @@ def em_client_class end end + def defers_finished? + # EventMachine 1.0.0+ has defers_finished? + EM.respond_to?(:defers_finished?) ? EM.defers_finished? : true + end + # runs inside each forked worker, this sits around and waits # for connections and doesn't die until the parent dies (or is # given a INT, QUIT, or TERM signal) @@ -101,7 +106,10 @@ def worker_loop(worker) # :nodoc: end end EM.add_periodic_timer(1) do - EM.stop if ! Rainbows.tick && conns.empty? && EM.reactor_running? + if ! Rainbows.tick && conns.empty? && defers_finished? && + EM.reactor_running? + EM.stop + end end LISTENERS.map! do |s| EM.watch(s, Rainbows::EventMachine::Server) do |c| diff --git a/t/app_deferred.ru b/t/app_deferred.ru index a70b33b..b3d7ff1 100644 --- a/t/app_deferred.ru +++ b/t/app_deferred.ru @@ -6,12 +6,18 @@ class DeferredApp < Struct.new(:app) def deferred?(env) - env["PATH_INFO"] == "/deferred" + env["PATH_INFO"] =~ %r{\A/deferred} end def call(env) env["rack.multithread"] or raise RuntimeError, "rack.multithread not true" body = "#{Thread.current.inspect}\n" + if env["PATH_INFO"] =~ %r{\A/deferred(\d+)} + delay = $1.to_i + File.open(ENV['fifo'], 'w') { |fp| fp.write "sleeping #{delay}s\n" } + body = "deferred sleep\n" + sleep(delay) + end headers = { "Content-Type" => "text/plain", "Content-Length" => body.size.to_s, diff --git a/t/t0700-app-deferred.sh b/t/t0700-app-deferred.sh index 90614b2..188fdde 100755 --- a/t/t0700-app-deferred.sh +++ b/t/t0700-app-deferred.sh @@ -15,7 +15,7 @@ CONFIG_RU=app_deferred.ru t_begin "setup and start" && { rainbows_setup rtmpfiles deferred_err deferred_out sync_err sync_out - rainbows -D -c $unicorn_config $CONFIG_RU + fifo=$fifo rainbows -D -c $unicorn_config $CONFIG_RU rainbows_wait_start } @@ -36,8 +36,20 @@ t_begin "deferred requests run in a different thread" && { test x"$(uniq < $deferred_out)" != x"$sync_thread" } -t_begin "termination signal sent" && { - kill $rainbows_pid +t_begin "deferred requests run after graceful shutdown" && { + # XXX sleeping 5s ought to be enough for SIGQUIT to arrive, + # hard to tell with overloaded systems... + s=5 + curl -sSf --no-buffer http://$listen/deferred$s \ + >$deferred_out 2>$deferred_err & + curl_pid=$! + msg="$(cat $fifo)" + kill -QUIT $rainbows_pid + test x"$msg" = x"sleeping ${s}s" + wait $curl_pid # for curl to finish + test $? -eq 0 + test ! -s $deferred_err + test x"$(cat $deferred_out)" = 'xdeferred sleep' } t_begin "no errors in stderr" && check_stderr -- EW