rainbows.git
4 years agoRainbows! 5.2.1masterv5.2.1
Eric Wong [Wed, 29 Jan 2020 23:32:22 +0000 (29 23:32 +0000)]
Rainbows! 5.2.1

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.

4 years agodoc: replace pandoc-"Markdown" with real manpages
Eric Wong [Thu, 9 Jan 2020 07:50:17 +0000 (9 07:50 +0000)]
doc: replace pandoc-"Markdown" with real manpages

Trying to install pandoc on an x86-64 Debian stable system says:
> Need to get 15.2 MB of archives.
> After this operation, 117 MB of additional disk space will be used.

My laptop is on metered Internet, now, and low on disk space, so
installing pandoc is too expensive.

There's also dozens of incompatible Markdown flavors out there,
most of which don't really handle manpages.

Updating the website now requires olddoc 1.8.0 (which is much
smaller than pandoc), but I'm the only one with that burden.  On
the flipside more users can update and read the manpages locally
without extra software, since nearly every developer's *nix
system has man(1) command, unlike pandoc.

4 years agodoc: switch bogomips.org to yhbt.net
Eric Wong [Thu, 9 Jan 2020 07:29:59 +0000 (9 07:29 +0000)]
doc: switch bogomips.org to yhbt.net

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).

4 years agodoc: switch homepage to dark216
Eric Wong [Mon, 22 Apr 2019 02:09:06 +0000 (22 02:09 +0000)]
doc: switch homepage to dark216

Earth Day!
  https://80x24.org/olddoc-public/20190422014906.4253-1-e@80x24.org/

5 years agoRainbows! 5.2.0v5.2.0
Eric Wong [Sat, 5 Jan 2019 20:36:57 +0000 (5 20:36 +0000)]
Rainbows! 5.2.0

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

5 years agovarious documentation updates
Eric Wong [Fri, 4 Jan 2019 21:46:23 +0000 (4 21:46 +0000)]
various documentation updates

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.

5 years agot/test_isolate: various version updates
Eric Wong [Fri, 18 May 2018 06:26:58 +0000 (18 06:26 +0000)]
t/test_isolate: various version updates

5 years agot/hijack.ru: avoid shadow warning
Eric Wong [Fri, 18 May 2018 06:44:59 +0000 (18 06:44 +0000)]
t/hijack.ru: avoid shadow warning

5 years agoquiet mismatched indentation warnings
Eric Wong [Fri, 18 May 2018 06:27:05 +0000 (18 06:27 +0000)]
quiet mismatched indentation warnings

Ruby trunk started warning about more mismatched indentations
starting around r62836.

7 years agoRainbows! 5.1.1v5.1.1
Eric Wong [Sun, 2 Apr 2017 02:04:32 +0000 (2 02:04 +0000)]
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

7 years agotests: update isolate deps for unicorn and raindrops
Eric Wong [Sun, 2 Apr 2017 00:32:55 +0000 (2 00:32 +0000)]
tests: update isolate deps for unicorn and raindrops

Newer versions were just released, so we should test with
them to prevent mishaps like
<https://bogomips.org/rainbows-public/9267B33C-D13C-47E1-8892-4777B96DDCD1@gmail.com/>
from surfacing :x

7 years agoworkaround for unicorn 5.3.0
Eric Wong [Sun, 2 Apr 2017 01:54:01 +0000 (2 01:54 +0000)]
workaround for unicorn 5.3.0

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/

7 years agoRainbows! 5.1.0 - rack 2.x compat, EM fixesv5.1.0
Eric Wong [Thu, 12 Jan 2017 22:35:41 +0000 (12 22:35 +0000)]
Rainbows! 5.1.0 - rack 2.x compat, EM fixes

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

7 years agodoc: additional disclaimers
Eric Wong [Thu, 12 Jan 2017 22:26:13 +0000 (12 22:26 +0000)]
doc: additional disclaimers

Honestly, these disclaimers should've been there all along;
and should apply to all servers handling multiple clients
within a single process.

7 years agoeventmachine: wait for deferred actions to finishem-deferred
Eric Wong [Mon, 9 Jan 2017 18:59:00 +0000 (9 18:59 +0000)]
eventmachine: wait for deferred actions to finish

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/

7 years agotests: re-enable EventMachine tests, again
Eric Wong [Mon, 9 Jan 2017 18:20:33 +0000 (9 18:20 +0000)]
tests: re-enable EventMachine tests, again

Based on activity in <git://github.com/eventmachine/eventmachine>,
EventMachine seems to be maintained, again, so resume testing our
integration tests.

7 years agoRevert "t/t0044-autopush.sh: remove test"
Eric Wong [Sat, 24 Dec 2016 21:41:24 +0000 (24 21:41 +0000)]
Revert "t/t0044-autopush.sh: remove test"

Stuck between a rock and a hard place..
This reverts commit 5c911ab2470a2ca9c140b3a2e20ae810bf758590
and restores autopush support when using kgio 2.11.0+

Explanations on the kgio mailing list below:

https://bogomips.org/kgio-public/20161216-kgio-2.11.0-released@fail/
https://bogomips.org/kgio-public/20161216000110.GA7366@untitled/T/#u

We can drop kgio when we drop Ruby <= 2.2 support in a few years.

7 years agosupport rack 2.x
Eric Wong [Thu, 17 Nov 2016 02:55:18 +0000 (17 02:55 +0000)]
support rack 2.x

This requires updating to unicorn 5.1+ to relax the rack
requirement.  Unlike unicorn, Rainbows! is considerably
larger and cannot function without rack installed.

There were no code changes required to pass the test suite;
but some other optional gems needed to be updated for testing.

Support for async_sinatra is no longer tested as that is tied
to rack 1.x; but the remaining EventMachine-dependent parts
remain tested.

Thanks to Julia López Aladro for reminding us on the mailing list:
https://bogomips.org/rainbows-public/CAPhSs6OAU+motd+MF=WOSek9==StLjEQJsNwAO3-aRWCZzhs=g@mail.gmail.com/

7 years agotests: use correct file:// URL for random_blob path
Eric Wong [Thu, 17 Nov 2016 02:41:55 +0000 (17 02:41 +0000)]
tests: use correct file:// URL for random_blob path

Apparently RFC1738 designates hostname support for file:// and
curl historically had this wrong, but my current curl version
(7.38.0-4+deb8u5 from Debian 8) is stricter.  Anyways, this seems
to handle $PWD with spaces and possibly other strange
characters, so URL encoding here doesn't seem to be strictly
necessary.

7 years agodoc: Static_Files: remove Future section
Eric Wong [Mon, 31 Oct 2016 20:27:00 +0000 (31 20:27 +0000)]
doc: Static_Files: remove Future section

sendfile(2) is fewer syscalls and FDs than splice(2),
and an open-file-cache is unlikely to be worth the complexity.

7 years agodoc: move homepage and update URLs to HTTPS
Eric Wong [Mon, 31 Oct 2016 20:13:40 +0000 (31 20:13 +0000)]
doc: move homepage and update URLs to HTTPS

Let's Encrypt is working well for us and having fewer domains
reduces subjectAltName bloat to speed up connection
establishment

HTTP will remain working indefinitely since some old systems
do not have modern TLS stacks.

8 years agodoc: bump olddoc to ~> 1.2 for extra NNTP URLs
Eric Wong [Sat, 9 Jan 2016 22:47:41 +0000 (9 22:47 +0000)]
doc: bump olddoc to ~> 1.2 for extra NNTP URLs

I forgot to add any NNTP servers to our .olddoc.yml :x

nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general

Not advertising additional HTTP-based URLs just yet.  They could
contain images/frames/JS/CSS and add unnecessary clutter to the
footer.  NNTP puts the client in control of UI.

8 years agoRainbows! 5.0.0 - maintained as long as anybody uses it!v5.0.0
Eric Wong [Wed, 25 Nov 2015 00:45:50 +0000 (25 00:45 +0000)]
Rainbows! 5.0.0 - maintained as long as anybody uses it!

This release syncs with unicorn 5 and drops some old compatibility
cruft from old releases.  Performance should be roughly unchanged
for Ruby 2.2 users while older Rubies (1.9.3 - 2.1) will see
minor, probably unnoticeable performance regressions.

Compatibility:

* The horrible, proprietary (:P) "Status:" response header is
  finally gone, saving at least 16 precious bytes in every HTTP
  response.  This should make it easier to write custom HTTP clients
  which are compatible across all HTTP servers.  It will hopefully
  make migrating between different Rack servers easier for new
  projects.

* Ruby 1.8 support removed.  Ruby 1.9.3 is currently the earliest
  supported version.  However, expect minor, likely-unnoticeable
  performance regressions if you use Ruby 2.1 or earlier.  Going
  forward, Rainbows! will favor the latest version (currently 2.2) of
  the mainline Ruby implementation, potentially sacrificing
  performance on older Rubies.

New features:

* sd_listen_fds(3) emulation added for systemd compatibility.
  You may now stop using PID files and other process monitoring
  software when using systemd.

* Newly-set TCP socket options are now applied to inherited sockets.

* Dynamic changes in the application to Rack::Utils::HTTP_STATUS
  hash is now supported; allowing users to set custom status lines
  in Rack to be reflected in unicorn.  This feature causes a minor
  performance regression, but is made up for Ruby 2.2 users with
  other optimizations.

* The monotonic clock is used under Ruby 2.1+, making the
  timeout feature immune to system clock changes.

As Rainbows! may be used anonymously without registration, the
project is committed to supporting anonymous and pseudonymous
help requests, contributions and feedback via plain-text mail to:

rainbows-public@bogomips.org

The mail submission port (587) is open to those behind firewalls
and allows access via Tor and anonymous remailers.
Archives are accessible via:

* http://bogomips.org/rainbows-public/
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
* nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general

and mirrored to various other places, so you do not even need
to use a valid address when posting.

18 changes since Rainbows! 4.7.0

      README: remove Zbatery references
      http_parser: handle keepalive_requests internally
      kill the moronic Status: header
      reflect changes in Rack::Utils::HTTP_STATUS_CODES
      reduce constant lookup dependencies
      http_parser: workaround hijack changes in unicorn 5
      http_server: add master_pid attribute
      stream_response_epoll: remove hijack_prepare call
      bump to unicorn 5.0.1, use monotonic clock
      add .gitattributes for Ruby method detection
      response: avoid garbage string entirely
      tiny bytecode reductions for cold paths
      Ruby 1.9.3+-only cleanups
      revactor: remove fcntl dependency
      response: simplify regexp
      t0105: fix test reliability
      fix Rainbows.now definition for old Rubies
      fix broken constant lookups in unmaintained bits

8 years agofix broken constant lookups in unmaintained bits
Eric Wong [Tue, 24 Nov 2015 22:55:30 +0000 (24 22:55 +0000)]
fix broken constant lookups in unmaintained bits

In case Revactor starts being maintained again...
(heck, it was probably the reason I started Rainbows! in the first
place...)

Our ReverseProxy stuff was never complete nor marketed;
and probably not worth keeping around at all.

8 years agofix Rainbows.now definition for old Rubies
Eric Wong [Tue, 24 Nov 2015 22:33:10 +0000 (24 22:33 +0000)]
fix Rainbows.now definition for old Rubies

Oops, blind substitution :x

8 years agot0105: fix test reliability
Eric Wong [Tue, 24 Nov 2015 21:28:50 +0000 (24 21:28 +0000)]
t0105: fix test reliability

It's possible curl will be sending to us and detect an error in the
send before it has a chance to read our (premature) 413 response.

Of course, we cannot afford to read an entire request when returning
a premature 413 response because we risk wasting bandwidth that way.

8 years agoresponse: simplify regexp
Eric Wong [Sat, 21 Nov 2015 08:52:32 +0000 (21 08:52 +0000)]
response: simplify regexp

Redundant \z statements are ugly and wastes 4 bytes on x86-64
according to ObjectSpace.memsize_of

8 years agorevactor: remove fcntl dependency
Eric Wong [Sat, 21 Nov 2015 08:52:31 +0000 (21 08:52 +0000)]
revactor: remove fcntl dependency

In the unlikely case somebody runs revactor, they won't need to
load the extra fcntl.so library into their process anymore.

In retrospect, we could've alway used IO#close_on_exec= since
it appeared in 1.9.1 and (IIRC) revactor always required 1.9.1+

8 years agoRuby 1.9.3+-only cleanups
Eric Wong [Sat, 21 Nov 2015 08:52:29 +0000 (21 08:52 +0000)]
Ruby 1.9.3+-only cleanups

unicorn 5 will only support Ruby 1.9.3 and later, so remove
some checks for Hash#compare_by_identity and IO.copy_stream
which we know exist in Ruby 1.9.

Favor &:sym proc dispatch to avoid unnecessary captures and
bytecode size increases, too.

Finally, ensure we fail fast by converting some literal
hashes to use non-arrow syntax for symbolic keys.

8 years agotiny bytecode reductions for cold paths
Eric Wong [Sat, 21 Nov 2015 08:52:28 +0000 (21 08:52 +0000)]
tiny bytecode reductions for cold paths

Less code in cold paths can improve speed for hot paths.

Single-byte strings for String#split is optimized in mainline Ruby,
so it's not actually a performance loss for sendfile_range in
response.rb

Regexps are at least 400 bytes each, so prefer non-Regexps
if possible, especially for cold sites where performance does
not matter.

8 years agoresponse: avoid garbage string entirely
Eric Wong [Sat, 21 Nov 2015 08:52:30 +0000 (21 08:52 +0000)]
response: avoid garbage string entirely

Even with frozen string literals enabled in Ruby 2.3.0dev,
dstrings still create garbage as the optimizer is
not yet smart enough to optimize it despite the limited
choice of internals being known.

Maybe in the future Ruby will be smart enough, but not yet...

8 years agoadd .gitattributes for Ruby method detection
Eric Wong [Sat, 21 Nov 2015 01:37:24 +0000 (21 01:37 +0000)]
add .gitattributes for Ruby method detection

The "diff" function detection for C does not map well to
Ruby files, take advantage of gitattributes(5) to improve
method name detection in generated patches as well as
making "git diff -W" output more useful.

8 years agobump to unicorn 5.0.1, use monotonic clock
Eric Wong [Wed, 18 Nov 2015 03:58:05 +0000 (18 03:58 +0000)]
bump to unicorn 5.0.1, use monotonic clock

The timeout (mis)feature in unicorn uses the monotonic clock
if available.  We must follow suit to avoid having our timeout
functionality completely broken.

8 years agostream_response_epoll: remove hijack_prepare call
Eric Wong [Wed, 18 Nov 2015 03:58:04 +0000 (18 03:58 +0000)]
stream_response_epoll: remove hijack_prepare call

unicorn 5.0.0 assumes Rack hijack is always available if
the application tries to use it, so the wrapper method
is removed.

8 years agohttp_server: add master_pid attribute
Eric Wong [Wed, 18 Nov 2015 03:58:03 +0000 (18 03:58 +0000)]
http_server: add master_pid attribute

We'll need this for unicorn 5, as they dropped this publically
accessible attribute while retaining the ivar.  Eventually we
may not have to check this attribute at all, instead detecting
parent death via worker pipe.

8 years agohttp_parser: workaround hijack changes in unicorn 5
Eric Wong [Sat, 14 Nov 2015 02:47:25 +0000 (14 02:47 +0000)]
http_parser: workaround hijack changes in unicorn 5

unicorn lost the hijack_setup method in version 5,
so we must recreate it ourselves.

8 years agoreduce constant lookup dependencies
Eric Wong [Sat, 14 Nov 2015 02:47:24 +0000 (14 02:47 +0000)]
reduce constant lookup dependencies

Unicorn 5 removes some constants we were using, and constant
lookups + inline caching are waste of time anyways on newer
Rubies with the opt_str_freeze bytecode instruction.

This may reduce performance for folks on older Rubies (probably
not noticeable); but improves performance for folks on newer
Rubies.

8 years agoreflect changes in Rack::Utils::HTTP_STATUS_CODES
Eric Wong [Sat, 14 Nov 2015 02:47:23 +0000 (14 02:47 +0000)]
reflect changes in Rack::Utils::HTTP_STATUS_CODES

Applications may want to alter the message associated with HTTP
status codes in Rack::Utils::HTTP_STATUS_CODES.  Avoid memoizing
status lines ahead-of-time

Note: this introduces a minor performance regression, but ought to
be unnoticeable unless you're running "Hello world"-type apps.

8 years agokill the moronic Status: header
Eric Wong [Sat, 14 Nov 2015 02:47:22 +0000 (14 02:47 +0000)]
kill the moronic Status: header

Whatever compatibility reasons which existed in 2009 likely do not exist
now.  Other servers (e.g. thin, puma) seem to work alright without it,
so there's no reason to waste precious bytes.

8 years agohttp_parser: handle keepalive_requests internally
Eric Wong [Sat, 14 Nov 2015 02:47:21 +0000 (14 02:47 +0000)]
http_parser: handle keepalive_requests internally

unicorn 5 dropped support for this, essentially allowing unlimited
persistent connections if we used the parser as-is.
Since most of our concurrency models cannot handle infinite
persistent connections without being vulnerable to DoS,
we must support keepalive_requests like nginx does.

8 years agoREADME: remove Zbatery references
Eric Wong [Mon, 19 Oct 2015 21:29:32 +0000 (19 21:29 +0000)]
README: remove Zbatery references

yahns runs as a single process just fine.

8 years agoRainbows! 4.7.0 - updates for ruby 2.3.0devv4.7.0
Eric Wong [Mon, 19 Oct 2015 21:10:04 +0000 (19 21:10 +0000)]
Rainbows! 4.7.0 - updates for ruby 2.3.0dev

This release includes fixes for upcoming changes in Ruby 2.3.0
(due December 2015).  Use of Rainbows! for new projects is not
recommended, try other servers instead.

* update dependencies for Ruby 2.2.0dev
* switch docs + website to olddoc
* gemspec: fix bad reference to rdoc_options
* README: reference yahns
* build: fix quoting issue with double parens
* response: avoid unnecessary args to IO.copy_stream
* t/close-has-env.ru: ensure close is idempotent
* sync_close: This fix breakage from Ruby-trunk r50118
* t/t0044-autopush.sh: remove test
* t/test_isolate.rb: updates for various gem versions
* response: convert source arg to path before IO.copy_stream
* speed up QUIT for users of the unicorn worker_loop
* gemspec: use SPDX-compatible license for GPL-2.0+

8 years agogemspec: use SPDX-compatible license for GPL-2.0+
Eric Wong [Mon, 19 Oct 2015 21:12:46 +0000 (19 21:12 +0000)]
gemspec: use SPDX-compatible license for GPL-2.0+

Current versions of RubyGems still complains about the '+'
is valid according to: http://spdx.org/licenses

8 years agospeed up QUIT for users of the unicorn worker_loop
Eric Wong [Thu, 15 Oct 2015 01:37:33 +0000 (15 01:37 +0000)]
speed up QUIT for users of the unicorn worker_loop

WriterThreadPool, WriterThreadSpawn, Base, and potentially
other rarely-used concurrency options experienced slow shutdowns
due to the destruction of a listener socket failing to wake up
a thread in IO.select.

Send ourselves a signal to interrupt the IO.select call in
the main thread to force the wakeup.

8 years agoresponse: convert source arg to path before IO.copy_stream
Eric Wong [Tue, 13 Oct 2015 23:45:59 +0000 (13 23:45 +0000)]
response: convert source arg to path before IO.copy_stream

This will allow us use the sendfile syscall under Linux on
Ruby which favor #read/#readpartial methods for non-IO objects.

This also allows us to revert changes made in
commit db790ff3531acdfa23ab290998bba29360a6782b
("sync_close: This fix breakage from Ruby-trunk r50118")

8 years agot/test_isolate.rb: updates for various gem versions
Eric Wong [Mon, 14 Sep 2015 05:33:18 +0000 (14 05:33 +0000)]
t/test_isolate.rb: updates for various gem versions

8 years agot/t0044-autopush.sh: remove test
Eric Wong [Mon, 14 Sep 2015 05:33:17 +0000 (14 05:33 +0000)]
t/t0044-autopush.sh: remove test

kgio no longer does anything with autopush, so this test is
broken.  Autopush was overkill and badly done (MSG_MORE is
better on Linux, FreeBSD should copy it :P).

8 years agosync_close: This fix breakage from Ruby-trunk r50118
Eric Wong [Mon, 14 Sep 2015 05:33:16 +0000 (14 05:33 +0000)]
sync_close: This fix breakage from Ruby-trunk r50118

By providing read+readpartial methods

IO.copy_stream behaves slightly differently when operating on
non-IO-subclassed objects nowadays.

Ref:
> * io.c (copy_stream_body): use the arguments without conversion if
>   having read, readpartial, and write methods, than conversion by
>   to_path method.  [ruby-core:68676] [Bug #11015]

8 years agot/close-has-env.ru: ensure close is idempotent
Eric Wong [Mon, 14 Sep 2015 05:33:15 +0000 (14 05:33 +0000)]
t/close-has-env.ru: ensure close is idempotent

Ruby 2.3.0 will have idempotent IO#close, so closing an IO
twice will be idempotent and not raise an IOError exception.
Ensure we do not rely on the IOError exception to catch
our own errors.

8 years agoresponse: avoid unnecessary args to IO.copy_stream
Eric Wong [Mon, 14 Sep 2015 05:33:14 +0000 (14 05:33 +0000)]
response: avoid unnecessary args to IO.copy_stream

Not all responses are seekable, so do not attempt to pass seek
arguments to them since Ruby may attempt to seek (and fail!).

8 years agobuild: fix quoting issue with double parens
Eric Wong [Mon, 14 Sep 2015 05:33:13 +0000 (14 05:33 +0000)]
build: fix quoting issue with double parens

Apparently GNU make parses that strangely and mangles it for the
shell...

9 years agoREADME: reference yahns
Eric Wong [Thu, 12 Feb 2015 19:06:08 +0000 (12 19:06 +0000)]
README: reference yahns

Because nobody has time to read about all the options Rainbows!
provides.  yahns is basically XEpollThreadPool, with minor
improvements which weren't easily supportable with other
concurrency options.

9 years agogemspec: fix bad reference to rdoc_options
Eric Wong [Tue, 13 Jan 2015 03:26:36 +0000 (13 03:26 +0000)]
gemspec: fix bad reference to rdoc_options

olddoc does not need or use this

9 years agoswitch docs + website to olddoc
Eric Wong [Sat, 10 Jan 2015 04:27:20 +0000 (10 04:27 +0000)]
switch docs + website to olddoc

wrongdoc was difficult to maintain because of the tidy-ffi
dependency and the HTML5 changes in Darkfish could not be
handled well by Tidy.

olddoc is superior as it generates leaner HTML which loads faster,
requires less scrolling and less processing power to render.
Aesthetic comparisons are subjective of course but completely
unimportant compared to speed and accessibility.

The presence of images and CSS on the old (Darkfish-based) site
probably set unreasonable expectations as to my ability and
willingness to view such things.  No more, the new website is
entirely simple HTML which renders well with even the wimpiest
browser (hell, olddoc even tries to generate readable raw HTML).

9 years agoupdate dependencies for Ruby 2.2.0dev
Eric Wong [Wed, 8 Oct 2014 21:24:41 +0000 (8 21:24 +0000)]
update dependencies for Ruby 2.2.0dev

This will allow me to test for unintentional breakage in 2.2.0.

Part of the reason for putting this project on maintenance mode
is because many of the libraries we depend on have not kept up
with the latest changes to Ruby.  So we will disable many tests
for 2.2+ to ensure the core parts remain working.

9 years agoRainbows! 4.6.2 - see you on the other sidev4.6.2
Eric Wong [Mon, 12 May 2014 07:01:27 +0000 (12 07:01 +0000)]
Rainbows! 4.6.2 - see you on the other side

This release updates documentation to reflect the migration of the
mailing list to a new public-inbox[1] instance.  This is necessary
due to the impending RubyForge shutdown on May 15, 2014.

The public-inbox address is: rainbows-public@bogomips.org
(no subscription required, plain text only)
ssoma[2] git archives: git://bogomips.org/rainbows-public
browser-friendly archives: http://bogomips.org/rainbows-public/

As evidenced by our git history, Rainbows! development has stagnated
over the years.  Rainbows! was designed to be an unopinionated
exploration into various concurrency options offered in the Ruby
ecosystem.

In recent years, I have come to favor the one-shot-based,
worst-of-all-worlds design of yahns: http://yahns.yhbt.net/README
Without the exploration from Rainbows!, yahns may not exist today.

Disclaimer: Rainbows! has always been intolerant of buggy/broken code in
libraries and apps.  yahns is even less tolerant of buggy/broken code,
as the SIGKILL-based timeout mechanism inherited unicorn is completely
gone. On the other hand, yahns has reasonable defaults so you do not
have to read documentation to configure it.

[1] policy: http://public-inbox.org/ - git://80x24.org/public-inbox
    an "archives first" approach to mailing lists
[2] mechanism: http://ssoma.public-inbox.org/ - git://80x24.org/ssoma
    some sort of mail archiver (using git)

9 years agodocumentation updates for Rubyforge death
Eric Wong [Mon, 12 May 2014 06:59:17 +0000 (12 06:59 +0000)]
documentation updates for Rubyforge death

We're migrating to a new public-inbox[1] + mailing list
rainbows-public@bogomips.org

[1] http://public-inbox.org/

9 years agoadd script for redirecting to new site
Eric Wong [Tue, 6 May 2014 21:12:56 +0000 (6 21:12 +0000)]
add script for redirecting to new site

9 years agoadd slrnpull.conf example for gmane archives
Eric Wong [Mon, 21 Apr 2014 19:16:46 +0000 (21 19:16 +0000)]
add slrnpull.conf example for gmane archives

In case anybody else wants to verify/check the archive or
use this for other projects, we'll document what we did here.

10 years agorainbows 4.6.1 - EventMachine fixesv4.6.1
Eric Wong [Sun, 2 Feb 2014 00:29:10 +0000 (2 00:29 +0000)]
rainbows 4.6.1 - EventMachine fixes

* event_machine: update for unicorn 4.8.x
* disable cramp tests for now
* update EventMachine tests
* set executable bit rainbows executable

Nothing relevant for non-EM users.

10 years agoset executable bit rainbows executable
Eric Wong [Wed, 29 Jan 2014 21:57:57 +0000 (29 21:57 +0000)]
set executable bit rainbows executable

Folks don't usually run from the source directory, but
RubyGems complains otherwise.

10 years agoupdate EventMachine tests
Eric Wong [Wed, 29 Jan 2014 21:56:32 +0000 (29 21:56 +0000)]
update EventMachine tests

EM 1.0.3 got released and seems to work under Ruby 2.1,
so re-enable EM and NeverBlock tests again.

10 years agodisable cramp tests for now
Eric Wong [Wed, 29 Jan 2014 21:52:17 +0000 (29 21:52 +0000)]
disable cramp tests for now

Cramp seems broken for now, we'll deal with it at another time
and I'm not sure if it ever took off...

10 years agoevent_machine: update for unicorn 4.8.x
Eric Wong [Wed, 29 Jan 2014 21:48:25 +0000 (29 21:48 +0000)]
event_machine: update for unicorn 4.8.x

unicorn 4.8.x shutdown handling is different and no longer removes
items from the event loop.  So we must do that ourselves to enable
graceful shutdown.  Otherwise, we'll time out on shutdowns and
the master will forcibly kill us.

10 years agoRainbows! 4.6.0 - fix unicorn 4.8.0 compatibilityv4.6.0
Eric Wong [Fri, 17 Jan 2014 20:13:42 +0000 (17 20:13 +0000)]
Rainbows! 4.6.0 - fix unicorn 4.8.0 compatibility

The unicorn 4.8.0 internal changes unfortunately broke some
unoffically supported behavior we depended on.  This release fixes
that, but as a result, we lose compatibility of older unicorn
versions.  (Oops!, oh well... :x)

There's also minor bugfixes and documentation updates.

In order to ease transitions to future versions of the GPL, we are
now "GPLv2 or later" instead of explicitly GPLv2 + GPLv3(-only).
The old Ruby 1.8 license remains an option.  If the FSF turns out
a horrible GPLv4, users are free to continue using GPLv2 or GPLv3.

10 years agoswitch homepage to http://rainbows.bogomips.org/
Eric Wong [Fri, 17 Jan 2014 20:25:06 +0000 (17 20:25 +0000)]
switch homepage to http://rainbows.bogomips.org/

RubyForge is going away, so we must migrate the homepage.
The mailing list will be migrated, soon.

10 years agounicorn 4.8 compatibility + test version bumps
Eric Wong [Fri, 17 Jan 2014 02:03:04 +0000 (17 02:03 +0000)]
unicorn 4.8 compatibility + test version bumps

Internal reworking of unicorn 4.8.0 completely broke us(!).
This commit fixes things, but it means we no longer support
unicorn <= 4.7.  Sorry about that.

10 years agoerror: silence ETIMEDOUT and EHOSTUNREACH errors
Eric Wong [Fri, 17 Jan 2014 01:31:43 +0000 (17 01:31 +0000)]
error: silence ETIMEDOUT and EHOSTUNREACH errors

There's nothing we can do about these errors due to
network failures and bad clients, either, so do not spew
a backtrace for them.

10 years agolicense: allow all future versions of the GNU GPL
Eric Wong [Sat, 26 Oct 2013 08:01:24 +0000 (26 08:01 +0000)]
license: allow all future versions of the GNU GPL

There is currently no GPLv4, so this change has no effect at the
moment.

In case the GPLv4 arrives and I am not alive to approve/review it,
the lesser of evils is have give blanket approval of all future GPL
versions (as published by the FSF).  The worse evil is to be stuck
with a license which cannot guarantee the Free-ness of this project
in the future.

This unfortunately means the FSF can theoretically come out with
license terms I do not agree with, but the GPLv2 and GPLv3 will
always be an option to all users.

10 years agoRakefile: kill raa_update task
Eric Wong [Mon, 30 Sep 2013 18:19:49 +0000 (30 18:19 +0000)]
Rakefile: kill raa_update task

RAA is dead.

10 years agoMatch against newer curl.
Lin Jen-Shin [Thu, 12 Sep 2013 16:41:16 +0000 (13 00:41 +0800)]
Match against newer curl.

My curl 7.32.0 would actually print 400 Bad Request
Hope this would make it match against newer or older curl.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
10 years agoSIGNALS: document SIGHUP/preload_app incompatibility
Eric Wong [Wed, 4 Sep 2013 17:09:33 +0000 (4 17:09 +0000)]
SIGNALS: document SIGHUP/preload_app incompatibility

This was documented in the unicorn docs, but not Rainbows!
(The major difference between unicorn and Rainbows! signal
handling is the deferred handling of SIGUSR1 in unicorn vs
the immediate handling in Rainbows!)

10 years agotest_isolate: update raindrops to 0.11.0
Eric Wong [Wed, 24 Apr 2013 23:08:32 +0000 (24 23:08 +0000)]
test_isolate: update raindrops to 0.11.0

raindrops 0.11.0 was released several days ago and contains
minor improvements + fixes.

11 years agoepoll+xepoll: clarify intent of these concurrency options
Eric Wong [Fri, 1 Mar 2013 23:29:00 +0000 (1 23:29 +0000)]
epoll+xepoll: clarify intent of these concurrency options

Via private communication, I learned of a user using XEpoll
when he should not have been.

11 years agoRainbows! 4.5.0 - hijacking supportv4.5.0
Eric Wong [Wed, 27 Feb 2013 10:25:21 +0000 (27 10:25 +0000)]
Rainbows! 4.5.0 - hijacking support

This release adds hijacking support for Rack 1.5.x users.
See Rack documentation for more information about hijacking.
Lin Jen-Shin also provided the -N/--no-default-middleware option.
Minor packaging cleanups and new HACKING document.

There are also some corner-case bugfixes for *Epoll* users
(sleepy_penguin, these bugs do not affect EM or Cool.io users)
and test suite portability improvements.

11 years agomanpage: update middleware-related documentation
Eric Wong [Tue, 26 Feb 2013 21:16:27 +0000 (26 21:16 +0000)]
manpage: update middleware-related documentation

-N/--no-default-middleware needs a corresponding manpage entry.

Additionally, the Rack::Chunked/ContentLength middleware comment
is out-of-date as of unicorn v4.1.0

11 years agoepoll/*: remove user-space array as active queue
Eric Wong [Tue, 26 Feb 2013 21:02:34 +0000 (26 21:02 +0000)]
epoll/*: remove user-space array as active queue

This prevents pathological starvation cases where the user-space
ready-list can be repopulated infinitely.  With EPOLLONESHOT,
epoll itself may be used for this task (at a slightly higher
cost) by enabling read/write checks, as the epoll ready-list
preserves event ordering when used with EPOLLONESHOT.

11 years agoxepoll_thread_*/client: EPOLLONESHOT implies EPOLLET
Eric Wong [Tue, 26 Feb 2013 20:07:30 +0000 (26 20:07 +0000)]
xepoll_thread_*/client: EPOLLONESHOT implies EPOLLET

No need to specify both flags for epoll (confirmed by reading
fs/eventpoll.c in the Linux kernel).

11 years agodoc: add HACKING document
Eric Wong [Tue, 26 Feb 2013 08:19:05 +0000 (26 08:19 +0000)]
doc: add HACKING document

Thanks to Alex Wolfe for noticing.

11 years agotests: update checks for Ruby 2.0.0
Eric Wong [Tue, 26 Feb 2013 07:42:51 +0000 (26 07:42 +0000)]
tests: update checks for Ruby 2.0.0

EventMachine/NeverBlock currently do not build on Ruby 2.0.0

11 years agobump unicorn dependency to 4.6.2+ for Ruby 2.0.0
Eric Wong [Tue, 26 Feb 2013 03:16:46 +0000 (26 03:16 +0000)]
bump unicorn dependency to 4.6.2+ for Ruby 2.0.0

This ensures we're compatible with the latest stable
Ruby version.

11 years agogemspec: set licenses= attribute
Eric Wong [Tue, 26 Feb 2013 03:14:26 +0000 (26 03:14 +0000)]
gemspec: set licenses= attribute

Old versions of RubyGems which could not handle this attribute
are likely no longer in use.

11 years agoGIT-VERSION-GEN: rewrite to manage RAINBOWS_VERSION const
Eric Wong [Sat, 16 Feb 2013 00:04:53 +0000 (16 00:04 +0000)]
GIT-VERSION-GEN: rewrite to manage RAINBOWS_VERSION const

This DRYs up versioning and makes packages easier to distribute.

11 years agohijacking support for Rack 1.5.x users
Eric Wong [Fri, 8 Feb 2013 22:45:20 +0000 (8 22:45 +0000)]
hijacking support for Rack 1.5.x users

This requires Rack 1.5.x and unicorn 4.6.0 for hijacking
support.  Older versions of Rack continue to work fine,
but we must use unicorn 4.6.0 features to support this.

11 years agotests: "wc -l" portability for *BSDs
Eric Wong [Mon, 4 Feb 2013 12:39:09 +0000 (4 12:39 +0000)]
tests: "wc -l" portability for *BSDs

On FreeBSD 9.0, "wc -l" emits leading whitespace, so
filter it through tr -d '[:space:]' to eliminate it.

11 years agotests: bump version dependencies for Isolate
Eric Wong [Fri, 25 Jan 2013 02:10:05 +0000 (25 02:10 +0000)]
tests: bump version dependencies for Isolate

Most of these test dependencies may be safely bumped.

11 years agotests: "wc -c" portability for *BSDs
Eric Wong [Thu, 24 Jan 2013 23:33:54 +0000 (24 23:33 +0000)]
tests: "wc -c" portability for *BSDs

On FreeBSD 9.0, "wc -c" emits leading whitespace, so
filter it through tr -d '[:space:]' to eliminate it.

11 years agotests: replace non-portable "date +%s" with ruby equivalent
Eric Wong [Thu, 24 Jan 2013 23:13:41 +0000 (24 23:13 +0000)]
tests: replace non-portable "date +%s" with ruby equivalent

"date +%s" is not in POSIX (it is in GNU, and at least FreeBSD
9.0, possibly earlier).  The Ruby equivalent should be
sufficiently portable between different Ruby versions.

This change was automated via:
perl -i -p -e 's/date \+%s/unix_time/' t/*.sh

11 years agotests: remove utee and use tee(1) instead
Eric Wong [Thu, 24 Jan 2013 22:59:16 +0000 (24 22:59 +0000)]
tests: remove utee and use tee(1) instead

POSIX already stipulates tee(1) must be unbuffered.  I think my
decision to use utee was due to my being misled by a bug in
older curl where -N did not work as advertised (but --no-buffer
did).

11 years agoAdd -N or --no-default-middleware option.
Lin Jen-Shin [Tue, 29 Jan 2013 03:44:06 +0000 (29 11:44 +0800)]
Add -N or --no-default-middleware option.

This would prevent Unicorn (Rainbows) from adding default middleware,
as if RACK_ENV were always none. (not development nor deployment)

This is implemented in Unicorn, so we only need to update
the option parser here.

Discussion thread on Unicorn mailing list:
http://rubyforge.org/pipermail/mongrel-unicorn/2013-January/001675.html

Signed-off-by: Eric Wong <normalperson@yhbt.net>
11 years agoepoll: ensure closing of pipelined clients if required
Eric Wong [Thu, 24 Jan 2013 19:47:41 +0000 (24 19:47 +0000)]
epoll: ensure closing of pipelined clients if required

on_read normally relies on the close checking in on_readable,
but on_deferred_write_complete may be called from on_writable
instead (bypassing the close check of on_readable).

This affects both Epoll and XEpoll users, but only if they
were sending responses via body#to_path and triggering
on_deferred_write_complete.

While we're at it, favor non-recursive want_more instead of
calling on_readable recursively in ev_write_responses to
prevent stack growth.

11 years agoRainbows! 4.4.3 - bugfixes for EventMachine usersv4.4.3
Eric Wong [Fri, 18 Jan 2013 11:21:45 +0000 (18 11:21 +0000)]
Rainbows! 4.4.3 - bugfixes for EventMachine users

This release fixes two EventMachine bugfixes from Lin Jen-Shin
and Mark J. Titorenko.  There are also some minor cleanups.

Lin Jen-Shin (1):
      event_machine: avoid close on deferred response

Mark J. Titorenko (1):
      event_machine: join reactor_thread if it is already running

Eric Wong (2):
      event_machine: cleanup confusing assignment
      t/GNUmakefile: cleanup test dependencies

11 years agot/GNUmakefile: cleanup test dependencies
Eric Wong [Thu, 17 Jan 2013 10:17:29 +0000 (17 10:17 +0000)]
t/GNUmakefile: cleanup test dependencies

The missing random_blob dependency was causing the following
to fail on a fresh clone:

make -C t ThreadPool.t0005-large-file-response.sh

11 years agoevent_machine: join reactor_thread if it is already running
Mark J. Titorenko [Fri, 11 Jan 2013 11:57:12 +0000 (11 11:57 +0000)]
event_machine: join reactor_thread if it is already running

...rather than falling through worker_loop

Prior to the application of this patch, if an EventMachine
reactor_thread has already been started elsewhere before the
worker_loop is entered, the worker_loop exits as a second call
to EM.run does not block the current thread.

This patch causes the worker_loop thread to join the
reactor_thread if it is running.

[ew: commit message formatting]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
11 years agoevent_machine: cleanup confusing assignment
Eric Wong [Wed, 19 Dec 2012 03:39:58 +0000 (19 03:39 +0000)]
event_machine: cleanup confusing assignment

11 years agoevent_machine: avoid close on deferred response
Lin Jen-Shin [Tue, 18 Dec 2012 20:03:55 +0000 (19 04:03 +0800)]
event_machine: avoid close on deferred response

close_connection_after_writing only if not deferred, as in
cool.io

Deferred responses may buffer more data down the line, so
keep the connection alive if we have a deferred response
body.

[ew: clear @deferred when we really want to quit,
 updated commit message]

Acked-by: Eric Wong <normalperson@yhbt.net>
11 years agoRainbows! 4.4.2 - EventMachine async.callback fixv4.4.2
Eric Wong [Thu, 6 Dec 2012 11:40:21 +0000 (6 11:40 +0000)]
Rainbows! 4.4.2 - EventMachine async.callback fix

One bugfix allows stream(:keep_open) in Sinatra to work
properly.

Thanks to W. Andrew Loe III for the informative bug report
and reproducible test case.

ref: http://mid.gmane.org/CA+-9oNd1EFqsniPkkPTwu5opTCinbM7-2KHoXov7+y3LE4s4Tg@mail.gmail.com

11 years agotest_isolate: bump eventmachine and sinatra deps
Eric Wong [Wed, 5 Dec 2012 03:34:02 +0000 (5 03:34 +0000)]
test_isolate: bump eventmachine and sinatra deps

Always ensuring we work with the latest versions.

11 years agoevent_machine: properly defer body.close for async
Eric Wong [Wed, 5 Dec 2012 03:08:19 +0000 (5 03:08 +0000)]
event_machine: properly defer body.close for async

Calling body.close in the normal write_response() code path
is incorrect, and only worked out of sheer luck with
Cramp and async_sinata.

This change allows stream(:keep_open) in Sinatra to work
properly.

Thanks to W. Andrew Loe III for the informative bug report
and reproducible test case.

ref: http://mid.gmane.org/CA+-9oNd1EFqsniPkkPTwu5opTCinbM7-2KHoXov7+y3LE4s4Tg@mail.gmail.com

11 years agoRainbows! 4.4.1 - a minor bugfix for Fiber usersv4.4.1
Eric Wong [Fri, 31 Aug 2012 01:53:43 +0000 (31 01:53 +0000)]
Rainbows! 4.4.1 - a minor bugfix for Fiber users

Fiber-based concurrency options avoids negative sleep
intervals.  Thanks to Lin Jen-Shin for pointing this out.