about summary refs log tree commit homepage
DateCommit message (Collapse)
2022-12-25test/test_extras_exec_cgi: drop Rack::ContentLength HEAD master
It is causing _blocked_zombie to fail on rtype=11 due to the addition of Content-Length making the client persistent when we didn't actually want it to be (for the test).
2022-12-25extras/exec_cgi: fix for newer Rack::ContentLength
Rack::ContentLength now unconditionally captures bodies and doesn't dup the data yield by body#each. Thus we can't reuse buffers anymore.
2022-12-22test/test_ssl: workaround multi-line exception messages
Needed for Ruby 3.1, and likely 3.2, as well...
2022-12-22standardize on 16384-byte reads
This is the size used by Ruby internally for IO.copy_stream. 8192 seems too small nowadays with the higher cost of syscalls.
2022-12-22http_response: clamp body read size
We don't want to overread in case a broken HTTP backend sends us excessive data.
2022-12-22test_buffer_tmpdir: drop fragile assertions
When tweaking buffer sizes, another IN_CREATE event can happen soon after the delete.
2021-10-09yahns 1.18.0 v1.18.0
8 changes since 1.17.0 (2019-04-22): worker: workaround old F_SETPIPE_SZ bug doc: favor File.read over IO.read to ease review proxy_pass: document as a public API doc: include Yahns/ directory on website extras/try_gzip_static: set "Vary: Accept-Encoding" on gzip do not sleep if signals are pending server: workaround Linux v5.5..v5.13 epoll bug gemspec: allow unicorn 6.x
2021-10-09gemspec: allow unicorn 6.x
The changes in unicorn 6.x don't affect us
2021-10-09server: workaround Linux v5.5..v5.13 epoll bug
epoll_wait() wakeups from QueueQuitter got lost during graceful shutdown since there's multiple worker threads operating off the same FD. Workaround the problem by re-arming the eventfd for every worker thread reaped. Link: https://yhbt.net/lore/lkml/20210405231025.33829-1-dave@stgolabs.net/
2021-10-09do not sleep if signals are pending
This should prevent missed/delayed wakeups if repeatedly kill(2)-ed.
2020-04-05extras/try_gzip_static: set "Vary: Accept-Encoding" on gzip
Some rare clients may not support gzip. So ensure cache layers don't inadvertantly serve cached content to them.
2019-05-10doc: include Yahns/ directory on website
Otherwise, https://yhbt.net/yahns/Yahns/ProxyPass.html won't be accessible
2019-05-10proxy_pass: document as a public API
Might as well... this has been in use at YHBT.net for ~4 years at this point. And given nginx has new corporate overlords, maybe a decidedly non-enterprisey alternative is worth "marketing" :P Previous discussion from 2016: https://YHBT.net/yahns-public/20160220081619.GA10850@dcvr.yhbt.net/
2019-05-09doc: favor File.read over IO.read to ease review
IO.read may invoke subprocesses, which can set off security warnings.
2019-05-04worker: workaround old F_SETPIPE_SZ bug
Linux before 4.9 (and before 3.16.57) failed to account for the existing size of a pipe before checking system resource limits and would return EPERM in that case. https://80x24.org/mirrors/linux.git/commit?id=b0b91d18e2e97b741b294af9333824ecc3fadfd8 https://lore.kernel.org/lkml/?q=s%3A%22fix+limit+checking+in+pipe_set_size%22 Based on a patch by Stephen Demjanenko for unicorn: https://bogomips.org/unicorn-public/1556922018-24096-1-git-send-email-sdemjanenko@gmail.com/
2019-04-22yahns 1.17.0 - Earth Day release v1.17.0
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
2019-04-22doc: remove inaccurate comment about "GNU-ism"
touch(1posix) documents the presence of "-r"
2019-04-21doc: update wording to avoid "mailing list"
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.
2019-04-21doc: update homepage to point to cgit install
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.
2019-04-21extras/autoindex: use dark colors by default
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.
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).