Date | Commit message (Collapse) |
|
This releases includes a few kqueue-related bugfixes from
Lin Jen-Shin <godfat@godfat.org>. There's also some
shutdown_timeout-related bugfixes and some cleanups to
reduce dependencies on kgio.
extras/exec_cgi and extras/autoindex both got some minor
updates; the latter of which defaults to a dark scheme to save
power on OLED and CRT displays (it is Earth Day, after all :>)
Eric Wong (25):
doc: fix git URLs in README and HACKING
http_client: do not warn on do_pread overreach
remove IO#close_on_exec= calls
yahns/worker: shrink pipe under Linux
test/test_extras_exec_cgi.rb: improve test reliability
extras/exec_cgi: remove kgio dependency
extras/exec_cgi: update copyright year and use SPDX
extras/exec_cgi: @body_tip is always set
extras/exec_cgi: support Process.spawn options (e.g. RLIMIT_*)
server_mp: favor "Kernel#select" instead of "IO.select"
server_mp: remove redundant srand call
extras/exec_cgi: remove unecessary .freeze calls
server: respect shutdown_timeout
server: extra shutdown timeout debugging
wbuf: use IO#write directly in Ruby 2.5+ for writev
worker: rely on F_SETPIPE_SZ to set mininum value
remove calls to kgio_wait_* able
do not shutdown until listeners are all stopped
README: remove SMTP-based subscription info
sigevent_*: fixup non-eventfd path
README: note HTTPS support for HTTP/1.1
extras/autoindex: use dark colors by default
doc: update homepage to point to cgit install
doc: update wording to avoid "mailing list"
doc: remove inaccurate comment about "GNU-ism"
Lin Jen-Shin (2):
Add QueueQuitter#closed? to queue_quitter_pipe.rb
@srv.shutdown could raise Errno::ENOTCONN
|
|
touch(1posix) documents the presence of "-r"
|
|
The concept of a "mailing list" infers the existence of a
centralized subscriber list, and hurts forkability. The
"public inbox" concept is a more accurate description and
mostly centralization-resistant, aside from domain names.
|
|
I've gotten cgit to work well for browsers without CSS
support (patches posted to <cgit@lists.zx2c4.com>).
For browsers with CSS support, the color scheme
is now dark and can help save electricity for users
of OLED and CRT displays.
|
|
Some browsers (e.g. Firefox 67.0a1 via "ui.systemUsesDarkTheme") are
adding support for the "prefers-color-scheme" @media query. So this
allows pages to respect user choice when it comes to dark or light
schemes.
OLED and CRT displays measure significant power savings when using
dark schemes. Dark themes work better with less ambient light, so
favoring darkness can lead to overall power savings even with CCFL
and LED-lit displays.
|
|
We've had HTTPS support for several years, now.
|
|
And slightly cleanup the Kgio::DefaultWaiters include for
the eventfd path, too.
Fixes: 96825e8ca734cfbb ("remove calls to kgio_wait_* able")
|
|
There's no point in advertising the mlmmj subscription: Nobody's
subscribed in ~5 years and I never wanted to deal with
delivering mail over SMTP, anyways.
The subscriber list is a point-of-centralization, anyways.
Furthermore, the NNTP, Atom, and HTML interfaces all allow
reading archives anonymously without needing a throwaway email
address.
|
|
Otherwise, listeners may still be injecting into the queue
and new clients may be accepted.
Fixes: 86ea6ed1417b ("server: respect shutdown_timeout")
|
|
IO#wait_readable existed since Ruby 2.0, so we don't need
to use the "kgio_"-prefixed version.
|
|
Old kernels running on alpha may EINVAL, here; but
modern kernels will automatically increase the passed
value to the minimum size supported by the kernel.
This only affects alpha, since all other arches use 4K
page size on Linux.
|
|
Slowly removing kgio dependencies...
|
|
Still not sure what's going on with the proxy_pass code,
but something in the Fdmap code is causing shutdowns to
take way longer than expected...
|
|
It seems there is still a bug in the proxy code which causes
this timeout expiries to be missed.
|
|
Operations via Array#map are NOT optimized away by opt_str_lit
in the VM, and they're unnecessary anyways with the
"frozen_string_literal: true" comment in Ruby 2.3+.
|
|
Ruby itself has tests for RNG reseeding at fork, so no need for
belt-and-suspenders code on our end.
|
|
Golfing to eliminate a constant lookup and inline-constant-cache entry
|
|
These options can be useful for limiting CGI process runtime and
memory usage.
|
|
No point in increasing the complexity for cases it's not.
|
|
Machine-parseability is useful for licenses.
|
|
We don't need non-blocking I/O at all in this module and it's
not coupled with the rest of yahns at all.
|
|
Make the this test less multi-core/scheduler dependent.
|
|
We use eventfd whereever possible, but workers still require
a pipe to the parent for death detection.
|
|
Since we've required Ruby 2.0+ for a while, we can assume
descriptors are created with IO#close_on_exec=true and
avoid bloating our code with calls to it.
|
|
Without sendfile, we can hit EOFError on IO#pread
if a file we're serving gets truncated mid-response.
This was causing test_truncated_sendfile failures;
but I didn't notice before because I forgot to set
SENDFILE_BROKEN=1 to disable the test.
|
|
After this fix, all tests except test_client_expire are
passing on my system (macos 10.12.6). Honestly, I don't
really care if it's working perfectly fine. It's just
nice to be able to run the same server on development
machine. Production is of course Linux.
|
|
Since we rely on this class being an IO-like class,
in Yahns::Queue#worker_thread we're using this method.
This fixes an actual error on lib/yahns/queue_kqueue.rb:56
|
|
Oops :x
|
|
This release fixes warnings for users combining Rack::Deflater
with HTTPS support:
https://yhbt.net/yahns-public/20180714005630.11812-1-e@80x24.org/
yahns-rackup(1) users may not specify "-O listen=inherit"
when spawning from systemd. The "listen" directive may
be omitted entirely from the yahns-config(5) files.
A few other cleanups and nothing interesting, otherwise.
20 yawn-worthy changes since v1.15.0 (2017-03-23):
config: more descriptive variable name
proxy_pass: comment explaining what rack.hijack calls
USR2 upgrades may use Process.spawn for vfork
avoid Thread#[] and Thread#[]= across threads
gemspec: declare Ruby 2.0+ dependency, here
test_bin: SO_KEEPALIVE value only needs to be true
rackup_handler: remove unnecessary branch
test_bin: use RbConfig.ruby for non-standard names
allow omitting specifying socket name when inheriting listen socket
server: fix incomplete comment about SSLContext#setup
test_rack_env: additional test for Rack environment
test: allow setting TAIL env to watch error logs
fix some unused variables
tests: thread-safety fixes
test/server_helper: describe reason for termination
test/test_ssl: set SSLContext#security_level=0
doc: https:// URLs instead of git://
http_client: clear backtrace on "wrong version number" in OpenSSL
openssl_client: do not attempt writes after SystemCallError
use IO#pread if available in Ruby 2.5
*ZZZZZZ*
|
|
In the future, this will allow sharing open files across
different clients when serving static files. For now, it
saves us one syscall.
|
|
Whenever @ssl.write_nonblock fails due to ECONNRESET/EPIPE in
Rack::Deflater#each; Rack::Deflater#each will still attempt to
write again in the "ensure" statement via Zlib::GzipWriter#close.
This causes SSL_write to complain of "bad length" or
"bad write retry" errors. Now, re-raise any SystemCallError
we caught from previous write_nonblock calls to prevent
calls to SSL_write which would trigger such an exception.
|
|
Errors which are the fault of the client should not generate
backtraces which can lead to dinky servers running out-of-space.
|
|
Might as well eat our own dogfood w.r.t. yahns TLS support
|
|
This is apparently needed to pass tests with a newer version of
OpenSSL found in Debian 9
|
|
A test failure was causing SIGQUIT to be delivered before
the forked process had a chance to hit trap(:QUIT).
|
|
We can't require 'proxy_pass' in both a parent and forked child,
so require it up front (as kcar will become a hard dependency
in place of unicorn).
Then, rely on GTL (global test lock) to synchronize around fork
since the VM may not always be able to protect that.
However, there's no need to synchronize around
spawn/system/`backtick`, as the VM should always be using those
in a thread-safe way (via vfork).
|
|
Current (tested r60757) ruby trunk warns in a few more places than
2.4.x did, so clean them up.
|
|
Setting TAIL=1 will automatically use the portable "tail -f".
This can be helpful in diagnosing failures during development.
GNU tail users may set TAIL="tail -F" (or "gtail -F")
to use the "-F" ("--follow=name") option to track changes
across SIGUSR1 log reopening testing.
|
|
Since there'll be some changes to accomodate the new parser,
ensure we prepare the Rack environment correctly.
|
|
Oops. Occasionally my brain experiences packet loss :x
|
|
Since the common case is still to run a single app inside yahns,
we can simplify setup a bit for systemd (and like) users by
allowing them to omit the "listen" directive when they are
running a single app in yahns.
|
|
It's possible to have "ruby" executables by other names
(e.g. "ruby24"), so use a supported API for finding our
executable.
This feature was added in Ruby 1.9.2, so it's safe to use
as we've always been 1.9.3+ (and nowadays 2.0+)
|
|
No point in optimizing for the single listener case in
setup code.
|
|
On FreeBSD 10.3 (and presumably other *BSD TCP stacks, the value
of SO_KEEPALIVE returned by getsockopt is 8, even when set to
'1' via setsockopt. Relax the test to only ensure the boolean
value is interpreted as "true".
Verified independently of Ruby using the following:
--------8<---------
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
static int err(const char *msg)
{
perror(msg);
return 1;
}
int main(void)
{
int sv[2];
int set = 1;
int got;
socklen_t len = (socklen_t) sizeof(int);
int rc;
rc = socketpair(PF_LOCAL, SOCK_STREAM, 0, sv);
if (rc)
return err("socketpair failed");
rc = setsockopt(sv[0], SOL_SOCKET, SO_KEEPALIVE, &set, len);
if (rc)
return err("setsockopt failed");
rc = getsockopt(sv[0], SOL_SOCKET, SO_KEEPALIVE, &got, &len);
if (rc)
return err("getsockopt failed");
printf("got: %d\n", got);
return 0;
}
|
|
We've been 2.0+ for a few years, actually.
|
|
Support for it may be removed in future versions of Ruby(*),
and we actually do not need to waste time looping when
a instance variable will do.
(*) https://bugs.ruby-lang.org/issues/13245
|
|
Remove false statements about close-on-exec being cleared in the
parent process (verified via strace) and refactor the code to
take full advantage of options for Process.spawn and Process.exec.
This avoids unnecessary CoW traffic for the common case where
before_exec is unset.
|
|
"call" is a generic name and may not obvious to somebody
new to the code.
|
|
That object is not a Rack app, so lets avoid confusing
ourselves.
|
|
Minor changes to reduce allocations and simplify our code
and dependencies. Nothing particularly interesting unless
you're the type of person who appreciates brake pedals
in with holes drilled in them for weight reduction.
11 changes since 1.14.1 (2016-12-14):
stream_input: avoid allocation for common #read case
proxy_pass: add a note about the instability of this
tee_input: simplify conditional for writing to temporary file
proxy_http_response: reduce memory pressure from larger headers
http_response: make response headers eligible for GC, sooner
update more referenced URLs to be HTTPS
chunk_body: nodoc this internal class
Revert "use olddoc 1.1.0 for generating NEWS + NEWS.atom.xml"
gemspec: stop advertising "private" email address
doc: design_notes: we do not use EPOLLEXCLUSIVE
README: update with disclaimer about subscription
Ovt punatrf pbzvat...
|