about summary refs log tree commit homepage
DateCommit message (Collapse)
2014-08-27the_metal: fix typo in buffer creation the_metal
Tested with the following example patch over a slow connection: --- a/examples/the_metal.rb +++ b/examples/the_metal.rb @@ -10,7 +10,7 @@ class Application # when write_head is called or have Transfer-Encoding: chunked # (in which case res.write must chunk for us) res.write_head 200, 'Content-Type' => 'text/plain' - res.write "Hello World\n" + 1000000.times { res.write "Hello World\n" } res.finish end end
2014-08-27the_metal: API change for serve -> call
ref: the_metal commit 26527612c7a227fa2b53dd7158408ae48d2c57ea "use `call` instead of `serve`"
2014-08-27the_metal: initial support
ref: git://github.com/tenderlove/the_metal.git
2014-08-20README: minor updates
* updated kqueue support status * noted sbrk/mmap scalability issue * speling fiks ("optimally") * indent "git clone" invocation * updated copyright status
2014-07-18http_client: clear some internal ivars on rack.hijack
We should no longer need HTTP parser or input body upon hijacking. Remove references to it so the GC can clean those up. This relies on the Rack application deleting "rack.input" from the Rack env, too.
2014-07-16yahns 1.3.1 - fix large response corruption v1.3.1
This release contains a major bug fix noticeable on FreeBSD VMs, but should affect Linux systems making large responses which require output buffering, too. * test_server: avoid multiple workers for dead parent check * wbuf: avoid corrupted large responses with zero-copy sendfile
2014-07-16wbuf: avoid corrupted large responses with zero-copy sendfile
This bug is noticeable on a amd64 FreeBSD 9.2 VM, and possible under Linux, too. This happens as a zero-copy sendfile implementation means pages queued for transmission by the sendfile system call should not be modified at any point after the sendfile syscall is made. To prevent modification, we replace the temporary file with a new one. This has a similar effect as truncate and can still prevent a dirty flush in cases when a client consumes the response fast enough. This reverts the misguided ade89b5142bedbcf07f38aa062bfdbfcb8bc48d3 commit ("wbuf: hack to avoid response corruption on FreeBSD") Note: this bug was finally fixed because I finally noticed this flaw in a different (non-Ruby, non-HTTP) server of mine.
2014-07-16test_server: avoid multiple workers for dead parent check
This test is less reliable when there are multiple workers as the second worker may not be ready to detect a dead parent. This is still a possible race if the master dies very quicklly before a worker is fully setup.
2014-05-12yahns 1.3.0 - new mailing list + fixups v1.3.0
Since RubyForge is going away, this release updates the documentation to point to the new public-inbox and mailing list at at: yahns-public@yhbt.net (no subscription required, plain text only) ssoma[1] git archives: git://yhbt.net/yahns-public browser-friendly archives: http://yhbt.net/yahns-public/ Traditional mailing list subscription is possible by sending a blank email to: yahns-public+subscribe@yhbt.net This also reworks master->worker signalling to use a pipe, avoiding problems with libraries which do not respond well to being interrupted by signals. There are also minor bugfixes and cleanups, see "git log -p" for full details. [1] http://ssoma.public-inbox.org/
2014-05-12server_mp: use soft_kill when reducing worker count
A follow-up-to commit 0c20f34c3d54e1c3d7b7a811c401e6858196e8a7 ("rework master-to-worker signaling to use a pipe"), there is no reason to use a real kill(2) here.
2014-05-12test_wbuf: workaround Linux-specific behavior
Followup-to commit ade89b5142bedbcf07f38aa062bfdbfcb8bc48d3 ("wbuf: hack to avoid response corruption on FreeBSD") It seems that we cannot test wbuf internals reliably outside of Linux, however as long as the end result (via HTTP) is unchanged on other OSes, we seem to be doing OK.
2014-05-12fdmap: short-circuit __expire if count == 0
This quiets down our logs when acceptors do not die quickly enough for us.
2014-05-09rework master-to-worker signaling to use a pipe
This prevents potential errors and compatibility problems with buggy libraries which do not respond well to signal delivery. Based on unicorn commit 6f6e4115b4bb03e5e7c55def91527799190566f2
2014-05-09sigevent: use non-blocking wakeup
There's almost no chance of blocking here, but better to be safe than sorry inside signal handlers. We would get the wakeup even if the pipe/event fd blocks.
2014-05-09server_mp: (style) favor &:proc method binding
We do this for conciseness.
2014-05-09server: account for premature grandparent death
When daemonizing, it is possible for the grandparent to be terminated by another process before the master can notify it. Do not abort the master in this case. unicorn commit 27ae210dde9228cfa96ea6b0f3a7e4047d3f70a4
2014-05-09update documentation to reflect public-inbox/list
Rubyforge is going away on May 15, so update our docs for it.
2014-04-21queue_kqueue: fixup comments from copy+paste
Much of this code was copied from the epoll queue.
2014-04-21extras/exec_cgi: pass SCRIPT_NAME from Rack env
Using the full, filesystem path name to our script is wrong and not according to RFC 3875.
2014-04-21extras/exec_cgi: allow passing custom env
Sometimes a CGI script wants to run with some environment variables set or overridden. Allow it.
2014-03-22tests: avoid autoclose when inheriting
GC will close redundantly and lead to EBADF when finalizing. This was probably harmless as the original IO objects remained marked; but do not count on it. Seeing EBADF in a MT process is a very bad sign (inadvertant information disclosure is only one race condition away). Fortunately, this bug was limited to our test suite :)
2014-03-15yahns 1.2.0 - preliminary kqueue/FreeBSD support v1.2.0
This release now depends on "kgio-sendfile", a (hopefully temporary) fork of the original sendfile gem for mainline ruby trunk compatibility and a (probably correct) FreeBSD-related bugfix. kqueue/FreeBSD support is considered highly experimental. Of course; you should never rely on anything in production unless you can get bugs fixed in every part of your stack; even the kernel. yahns (ab)uses kqueue and epoll in uncommon ways, so you may encounter subtle kernel bugs along the way. Because yahns has been self-hosting its own website for months without crashes or major problems (BORING! :P), I've decided to start hosting the yahns website <http://yahns.YHBT.net/README> with ruby trunk (currently r45341). yahns - dangerous by design (and sleepy!)
2014-03-15minor style fix for consistency
We favor foo(&:bar) when possible for conciseness.
2014-03-15wbuf: hack to avoid response corruption on FreeBSD
This likely makes no difference in 99% of real world situations with fast response generation. The only case where lack of output buffer bypass makes a difference is when the following sequence happens: 1) a giant response cannot fit into socket buffers 2) temporary file created for buffering 3) client consumes output so we get more space in socket buffers 4) app response generation continues (streaming response) 5) we successfully write _all_ previously buffered data to socket 6) we may bypass buffering for data generated in step 4 So right now, we cannot do step 6 outside of Linux. Instead, once an output buffer is created; we must always write to the output buffers.
2014-03-13test/helper: compat w/ coverage in Feature #9508
There's a feature request for better coverage support in ruby-trunk https://bugs.ruby-lang.org/issues/9508 At minimum, we need to preserve compatibility; but we should set aside time to take advantage of the extra coverage support.
2014-03-13Merge remote-tracking branch 'origin/freebsd'
* origin/freebsd: implement kqueue and sendfile compatibility support test: log skipped tests on non-Linux systems test_server: check_client_connection uses Unix sockets test_client_expire: add delays for non-Linux OSes wbuf_common: avoid trysendfile on empty sf_count sigevent_pipe: kgio_wait_writable takes variadic args queue_quitter_pipe: do not prematurely close reader
2014-03-13gemspec: switch to kgio-sendfile for ruby-trunk compat
Hopefully kgio-sendfile is only a temporary fork until Toby gets back to maintaining the normal sendfile gem.
2014-02-08implement kqueue and sendfile compatibility support
Tested on Debian GNU/kFreeBSD (sid): make check SENDFILE_BROKEN=1
2014-02-08test: log skipped tests on non-Linux systems
2014-02-08test_server: check_client_connection uses Unix sockets
TCP socket timing is too varied over different OSes, Unix sockets seem to test more reliably than TCP ones on my Debian GNU/kFreeBSD system.
2014-02-08test_client_expire: add delays for non-Linux OSes
Not all TCP stacks behave the same with timing-sensitive tests. Fortunately these timing differences aren't very critical over real networks.
2014-02-08wbuf_common: avoid trysendfile on empty sf_count
We may unnecessarily drop persistent connections from this bug, and we had an incorrect assertion in our unit test, even.
2014-02-08sigevent_pipe: kgio_wait_writable takes variadic args
We may pass a timeout to kgio_wait_writable during shutdown.
2014-02-08queue_quitter_pipe: do not prematurely close reader
This will lead to ENOENT when placing writer into kqueue changelist via kevent(2)
2014-02-04yahns 1.1.0 - MOAR SLEEPY v1.1.0
On responses with a known, non-zero Content-Length, yahns will now automatically use the MSG_MORE flag when sending HTTP headers. This reduces TCP packet transmits and allows clients to wake up and read one less time. This is similar to the TCP_NOPUSH/TCP_CORK functionality of other servers, but requires no additional syscalls. It is only supported on the Linux kernel, however (but yahns is currently epoll-only with kqueue support on the horizon). Eric Wong (5): quiet down EHOSTUNREACH errors http_response: use kgio_syssend with MSG_MORE load yahns/version file socket_helper: remove SO_REUSEPORT define for untested arches response: do not use MSG_MORE on empty bodies
2014-02-04response: do not use MSG_MORE on empty bodies
We must not cork response headers when the response body is empty, otherwise those headers will be delayed by 200ms.
2014-02-04socket_helper: remove SO_REUSEPORT define for untested arches
We'll let systems with updated glibc headers define those (or interested users, if any, on those architectures test and report back to us). No point in causing unnecessary breakage if we screw things up.
2014-02-04load yahns/version file
We need this for "yahns --version" on the command line
2014-02-04http_response: use kgio_syssend with MSG_MORE
If Content-Length is known, try to save some bandwidth by corking the headers until the body is sendable. This allows us to avoid sending an extra packet for small HTTP responses. This allows high-performance websites like YHBT.net to be served faster!
2014-01-04quiet down EHOSTUNREACH errors
We can't do anything about EHOSTUNREACH, so quiet the backtrace. I've noticed this happening very rarely (once every few weeks?) while yahns was exposed to untrusted traffic.
2014-01-02yahns 1.0.0 v1.0.0
Mostly fixes for the extras/* stuff running on yahns.YHBT.net and documentation/packaging fixes. Anyways, this is hosting the yahns website for a while now (running rack.git) without any major issues. Also, the mailing list will need to move/change because Rubyforge is going away. Everything I said for the unicorn ML applies to this list, too: http://mid.gmane.org/20131217015614.GB1125@dcvr.yhbt.net
2014-01-01http_response: avoid concurrent httpdate calls under rbx
Unicorn::HttpResponse#httpdate is currently not thread-safe without GVL.
2013-12-30extras/*: use binary path names
Proper POSIX filesystems are encoding-agnostic.
2013-12-27tests: document and check for ab(1) dependency
ab(1) is less common than our other dependencies, so allow tests to run without it.
2013-12-27gemspec: relax unicorn dependency to allow 4.7
unicorn uses semantic versioning, and we are compatible with 4.7.0, so use it.
2013-12-22gemspec: hopefully fix minitest dependency
Having two ~> dependencies doesn't OR the dependency as intended. In either case, assume 6.x is not compatible out-of-the box and do not enable it. While we're at it, document our dependency policy for the test library.
2013-12-22extras/exec_cgi: skip GATEWAY_INTERFACE from Rack env
We will override it internally regardless of middlewares.
2013-12-19extras/exec_cgi: document dependency on current rack.git
This was causing zombies on the bogomips.org cgit instance.
2013-11-27http_response: remove unnecessary freeze
We do not use these strings in string assignment, and we're not in danger of modifying these strings in place, so do not freeze them.
2013-11-16extras/exec_cgi: split head from body properly
The body may contain extra repeated newlines, of course