about summary refs log tree commit homepage
DateCommit message (Collapse)
2019-04-02README: note HTTPS support for HTTP/1.1
We've had HTTPS support for several years, now.
2019-04-02sigevent_*: fixup non-eventfd path
And slightly cleanup the Kgio::DefaultWaiters include for the eventfd path, too. Fixes: 96825e8ca734cfbb ("remove calls to kgio_wait_* able")
2019-04-02README: remove SMTP-based subscription info
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.
2019-01-08do not shutdown until listeners are all stopped
Otherwise, listeners may still be injecting into the queue and new clients may be accepted. Fixes: 86ea6ed1417b ("server: respect shutdown_timeout")
2019-01-07remove calls to kgio_wait_* able
IO#wait_readable existed since Ruby 2.0, so we don't need to use the "kgio_"-prefixed version.
2019-01-05worker: rely on F_SETPIPE_SZ to set mininum value
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.
2019-01-05wbuf: use IO#write directly in Ruby 2.5+ for writev
Slowly removing kgio dependencies...
2018-12-30server: extra shutdown timeout debugging
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...
2018-12-30server: respect shutdown_timeout
It seems there is still a bug in the proxy code which causes this timeout expiries to be missed.
2018-12-28extras/exec_cgi: remove unecessary .freeze calls
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+.
2018-12-28server_mp: remove redundant srand call
Ruby itself has tests for RNG reseeding at fork, so no need for belt-and-suspenders code on our end.
2018-12-28server_mp: favor "Kernel#select" instead of "IO.select"
Golfing to eliminate a constant lookup and inline-constant-cache entry
2018-12-28extras/exec_cgi: support Process.spawn options (e.g. RLIMIT_*)
These options can be useful for limiting CGI process runtime and memory usage.
2018-12-27extras/exec_cgi: @body_tip is always set
No point in increasing the complexity for cases it's not.
2018-12-27extras/exec_cgi: update copyright year and use SPDX
Machine-parseability is useful for licenses.
2018-12-27extras/exec_cgi: remove kgio dependency
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.
2018-12-27test/test_extras_exec_cgi.rb: improve test reliability
Make the this test less multi-core/scheduler dependent.
2018-12-13yahns/worker: shrink pipe under Linux
We use eventfd whereever possible, but workers still require a pipe to the parent for death detection.
2018-12-08remove IO#close_on_exec= calls
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.
2018-12-08http_client: do not warn on do_pread overreach
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.
2018-12-08@srv.shutdown could raise Errno::ENOTCONN
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.
2018-12-08Add QueueQuitter#closed? to queue_quitter_pipe.rb
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
2018-08-06doc: fix git URLs in README and HACKING
Oops :x
2018-08-06yahns 1.16.0 v1.16.0
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*
2018-08-05use IO#pread if available in Ruby 2.5
In the future, this will allow sharing open files across different clients when serving static files. For now, it saves us one syscall.
2018-08-05openssl_client: do not attempt writes after SystemCallError
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.
2018-08-05http_client: clear backtrace on "wrong version number" in OpenSSL
Errors which are the fault of the client should not generate backtraces which can lead to dinky servers running out-of-space.
2018-07-03doc: https:// URLs instead of git://
Might as well eat our own dogfood w.r.t. yahns TLS support
2018-07-03test/test_ssl: set SSLContext#security_level=0
This is apparently needed to pass tests with a newer version of OpenSSL found in Debian 9
2018-07-03test/server_helper: describe reason for termination
A test failure was causing SIGQUIT to be delivered before the forked process had a chance to hit trap(:QUIT).
2018-05-01tests: thread-safety fixes
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).
2017-11-14fix some unused variables
Current (tested r60757) ruby trunk warns in a few more places than 2.4.x did, so clean them up.
2017-04-27test: allow setting TAIL env to watch error logs
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.
2017-04-26test_rack_env: additional test for Rack environment
Since there'll be some changes to accomodate the new parser, ensure we prepare the Rack environment correctly.
2017-04-20server: fix incomplete comment about SSLContext#setup
Oops. Occasionally my brain experiences packet loss :x
2017-04-06allow omitting specifying socket name when inheriting listen socket
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.
2017-04-06test_bin: use RbConfig.ruby for non-standard names
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+)
2017-04-05rackup_handler: remove unnecessary branch
No point in optimizing for the single listener case in setup code.
2017-04-03test_bin: SO_KEEPALIVE value only needs to be true
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; }
2017-04-03gemspec: declare Ruby 2.0+ dependency, here
We've been 2.0+ for a few years, actually.
2017-04-03avoid Thread#[] and Thread#[]= across threads
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
2017-04-03USR2 upgrades may use Process.spawn for vfork
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.
2017-04-03proxy_pass: comment explaining what rack.hijack calls
"call" is a generic name and may not obvious to somebody new to the code.
2017-04-03config: more descriptive variable name
That object is not a Rack app, so lets avoid confusing ourselves.
2017-03-23yahns 1.15.0 v1.15.0
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...
2017-03-21README: update with disclaimer about subscription
Also, give the Atom feed a little more visibility.
2017-03-18doc: design_notes: we do not use EPOLLEXCLUSIVE
And clarify that we only have one thread by default. Since EPOLLEXCLUSIVE seems to have gotten some more press, I guess we should emphasize our design does not rely on it.
2017-03-05gemspec: stop advertising "private" email address
Anonymity is a job for the users sending the mail; lets not hold ourselves unnecessarily accountable for anonymizing or hiding messages.
2017-03-05Revert "use olddoc 1.1.0 for generating NEWS + NEWS.atom.xml"
This reverts commit bcf0f0efb3173b18957ddba2af6592219a2d72a3. The dependency on olddoc makes it slightly more difficult for users to package their own and distribute RubyGems. We will also not host HTML RDoc files since we have no internal API to support.
2017-03-05chunk_body: nodoc this internal class
Although we do not publish RDoc-generated documentation on our website, other places may, an people use ri(1) locally.