about summary refs log tree commit homepage
DateCommit message (Collapse)
2015-04-24unicorn 4.9.0 - TempfileReaper support in Rack 1.6 v4.9.0
This release supports the Rack::TempfileReaper middleware found in rack 1.6 for cleaning up disk space used by temporary files. We also use Rack::TempfileReaper for cleaning up large temporary files buffered with TeeInput. Users on rack 1.5 and earlier will see no changes. There's also a bunch of documentation/build system improvements. This is likely to be the last Ruby 1.8-compatible release, unicorn 5.x will require 1.9.3 or later as well as dropping lots of cruft (the stupid "Status:" header in responses being the most notable). 21 changes backported from master: ISSUES: update with mailing list subscription FAQ: add entry for Rails autoflush_log dev: remove isolate dependency unicorn.gemspec: depend on test-unit 3.0 remove RubyForge and Freecode references remove mongrel.rubyforge.org references examples: add run_once to before_fork hook example t/t0002-parser-error.sh: relax test for rack 1.6.0 switch docs + website to olddoc README: clarify/reduce references to unicorn_rails gemspec: fixup olddoc migration GNUmakefile: fix clean gem build + reduce build cruft doc: update support status for Ruby versions fix uninstalled testing and reduce require paths test_socket_helper: do not depend on SO_REUSEPORT ISSUES: add section for bugs in other projects explain 11 byte magic number for self-pipe Links: mark Rainbows! as historical, reference yahns doc: document UNICORN_FD in manpage tee_input: support for Rack::TempfileReaper middleware support TempfileReaper in deployment and development envs
2015-04-24support TempfileReaper in deployment and development envs 4.x-stable
rack 1.6 added a TempfileReaper middleware to cleanup temporary files. Enable it by default for users running rack 1.6 or later to avoid leaving temporary files around.
2015-04-24tee_input: support for Rack::TempfileReaper middleware
Rack::TempfileReaper was added in rack 1.6 to cleanup temporary files. Make Unicorn::TmpIO ducktype-compatible so Rack::TempfileReaper may be used to free up space used by temporary buffer files. Ref: <CY1PR0301MB078011EB5A22B733EB222A45A4EE0@CY1PR0301MB0780.namprd03.prod.outlook.com> Reported-by: Mike Mulvaney <MMulvaney@bna.com>
2015-04-22doc: document UNICORN_FD in manpage
Due to the prevalence of socket activation in modern init systems, we shall document UNICORN_FD (previously an implementation detail) in the manpage.
2015-04-22Links: mark Rainbows! as historical, reference yahns
Pushing the boundaries of bad marketing :P
2015-04-22explain 11 byte magic number for self-pipe
Oops, this should've been explained long ago but apparently not. In response to a comment on http://www.sitepoint.com/the-self-pipe-trick-explained/ > Does anybody know why both unicorn and foreman read 11 bytes from > self-pipe? Unfortunately I couldn't find a way to comment on the site on a JavaScript-free browser nor does it seem possible without registering. Again, anybody can send plain-text mail to: unicorn-public@bogomips.org No registration, no real name policy, no terms-of-service, just plain-text. Feel free to use Tor, mixmaster or any anonymity service, too.
2015-04-22ISSUES: add section for bugs in other projects
This is not anything new, just documenting what has been going on since the beginning. There's been a small number of generic networking (or mm) bugs in the kernel which affect unicorn, but are usually found and fixed with more popular, non-Ruby servers, first. Aside from generic performance problems, I don't think there's ever been a glibc bug which affected unicorn.
2015-04-22test_socket_helper: do not depend on SO_REUSEPORT
Older Rubies (2.0) may not define SO_REUSEPORT even if the kernel and libc support it
2015-04-22fix uninstalled testing and reduce require paths
This fixes a bug introduced in commit fe83ead4eae6f011fa15f506cd80cb4256813a92 (GNUmakefile: fix clean gem build + reduce build cruft) which broke clean Ruby installations without an existing unicorn gem installed :x [fixed test/unit/test_http_parser_xftrust.rb for backport]
2015-04-22doc: update support status for Ruby versions
unicorn 5 will not support Ruby 1.8 anymore. Drop mentions of Rubinius, too, it's too difficult to support due to the proprietary and registration-required nature of its bug tracker. The smaller memory footprint and CoW-friendly memory allocator in mainline Ruby is a better fit for unicorn, anyways. Since Ruby 1.9+ bundles RubyGems and gem startup is faster nowadays, we'll just depend on that instead of not loading RubyGems. Drop the local.mk.sample file, too, since it's way out-of-date and probably isn't useful (I have not used it in a while). [reinstate 1.9 version check for listener_fds in backport]
2015-04-22GNUmakefile: fix clean gem build + reduce build cruft
Ensure we have a NEWS file for building the gem beforehand. We don't need to polute lib/ with object files, either.
2015-04-22gemspec: fixup olddoc migration
rdoc_options is no longer necesary with olddoc as olddoc can infer document titles and only generates cgit-compatible URLs to source code.
2015-04-22README: clarify/reduce references to unicorn_rails
unicorn_rails is an ancient compatibility wrapper for ancient versions of Rails which did not use Rack. Those applications have likely moved on, so stop promoting unicorn_rails.
2015-04-22switch 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.
2015-04-22t/t0002-parser-error.sh: relax test for rack 1.6.0
This overly zealous test was broken by: rack commit be28c6a2ac152fe4adfbef71f3db9f4200df89e8 ("update HTTP status codes to IETF RFC 7231")
2015-04-22examples: add run_once to before_fork hook example
There may be code in a before_fork hook which should run only once, document an example using a guard variable since it may not be immediately obvious to all users. Inspired-by: BrĂ¡ulio Bhavamitra <braulio@eita.org.br> http://bogomips.org/unicorn-public/m/20141004015707.GA1951@dcvr.yhbt.net.html
2015-04-22remove mongrel.rubyforge.org references
mongrel.rubyforge.org has been dead longer than rubyforge.org!
2015-04-22remove RubyForge and Freecode references
Both sites are gone.
2015-04-22unicorn.gemspec: depend on test-unit 3.0
test-unit 3 and minitest 5 will have equal support status as a bundled gems when Ruby 2.2.0 is released in December 2014. These bundled gems will appear in the user-oriented tarball installations, but do not get installed by "make install" when installing Ruby from SVN or git. test-unit appears to be actively maintained and good at keeping backwards compatibility even on a major version change, so this means no code changes on our end. I am not convinced switching to minitest is worth the effort. Cc: Ken Dreyer <ktdreyer@ktdreyer.com>
2015-04-22dev: remove isolate dependency
It seems unnecessary with current versions of RubyGems supporting development dependencies.
2015-04-22FAQ: add entry for Rails autoflush_log
Thanks to Cedric Maion for bringing this up on the mailing list: http://bogomips.org/unicorn-public/m/20140703144048.GA6674@cedric-maion.com
2015-04-22ISSUES: update with mailing list subscription
mlmmj seems quite usable and maintainable, so we'll run it.
2014-05-07unicorn 4.8.3 - the end of an era v4.8.3
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: unicorn-public@bogomips.org (no subscription required, plain text only) ssoma[2] git archives: git://bogomips.org/unicorn-public browser-friendly archives: http://bogomips.org/unicorn-public/ Using, getting help for, and contributing to unicorn will never require any of the following: 1) non-Free software (including SaaS) 2) registration or sign-in of any kind 3) a real identity (we accept mail from Mixmaster) 4) a graphical user interface Nowadays, plain-text email is the only ubiquitous platform which meets all our requirements for communication. There is also one small bugfix to handle premature grandparent death upon initial startup. Most users are unaffected. [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)
2014-05-06swap out most of the rubyforge.org links
Update the old mailing list info with our new public-inbox info. The old mongrel.rubyforge.org links have been dead for years, oh well. There's only a few days left of RubyForge left...
2014-05-04http_server: handle 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. This may fix the following issue: https://github.com/kostya/eye/issues/49 (which I was notified of privately via email)
2014-04-21add 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.
2014-04-02oob_gc: link to Discourse OobGC for Ruby 2.0 users
Thanks to Sam Saffron for the heads up.
2014-03-29oobgc: link to Aman's gctools for Ruby 2.1+
I've never liked OobGC, so "hot potato!" :)
2014-02-19script/isolate_for_tests: bump to latest versions
kgio and raindrops were both updated for Ruby 2.2.0dev r44955 and later, so depend on them in our tests.
2014-02-19remove SSL tests
This feature is on hold for now, since it never really took off and kgio-monkey is more-or-less abandoned. I'm not looking forward to supporting OpenSSL unless there's interest. This was mainly intended as an experiment to deal with a bad hardware/firmware situation on a LAN I have. It allowed SSL to abort on corrupt packets.
2014-02-05unicorn 4.8.2 - avoid race condition during worker startup v4.8.2
We close SELF_PIPE in the worker immediately, but signal handlers do not get setup immediately. So prevent workers from erroring out due to invalid SELF_PIPE.
2014-02-01avoid race condition during worker startup
We close SELF_PIPE in the worker immediately, but signal handlers do not get setup immediately. So prevent workers from erroring out due to invalid SELF_PIPE.
2014-01-29unicorn 4.8.1 v4.8.1
fix races/error handling in worker SIGQUIT handler This protects us from two problems: 1) we (or our app) somehow called IO#close on one of the sockets we listen on without removing it from the readers array. We'll ignore IOErrors from IO#close and assume we wanted to close it. 2) our SIGQUIT handler is interrupted by itself. This can happen as a fake signal from the master could be handled and a real signal from an outside user is sent to us (e.g. from unicorn-worker-killer) or if a user uses the killall(1) command.
2014-01-29fix races/error handling in worker SIGQUIT handler
This protects us from two problems: 1) we (or our app) somehow called IO#close on one of the sockets we listen on without removing it from the readers array. We'll ignore IOErrors from IO#close and assume we wanted to close it. 2) our SIGQUIT handler is interrupted by itself. This can happen as a fake signal from the master could be handled and a real signal from an outside user is sent to us (e.g. from unicorn-worker-killer) or if a user uses the killall(1) command.
2014-01-11unicorn 4.8.0 - big internal changes, but compatible v4.8.0
This release contains fairly major internal workings of master-to-worker notifications. The master process no longer sends signals to workers for most tasks. This works around some compatibility issues with some versions of the "pg" gem (and potentially any other code which may not handle EINTR properly). One extra benefit is it also helps stray workers notice a rare, unexpected master death more easily. Workers continue to (and will always) accept existing signals for compatibility with tools/scripts which may signal workers. PID file are always written early (even on upgrade) again to avoid breaking strange monitoring setups which use PID files. Keep in mind we have always discouraged monitoring based on PID files as they are fragile. We now avoid bubbling IOError to the Rack app on premature client disconnects when streaming the input body. This is usually not a problem with nginx, but may be on some LAN setups without nginx). Thanks to Sam Saffron, Jimmy Soho, Rodrigo Rosenfeld Rosas, Michael Fischer, and Andrew Hobson for their help with this release. Note: the unicorn mailing list will be moved/changed soon due to the RubyForge shutdown. unicorn will always rely only on Free Software. There will never be any sign-up requirements nor terms-of-service to agree to when communicating with us.
2014-01-11GNUmakefile: add "check" target for running all tests
"check" rolls off the fingers of users familiar with GNU Automake more easily. The "test-all" target is preserved for compatibility.
2013-12-09unicorn 4.8.0pre1 v4.8.0.pre1
Eric Wong (6): tests: fix SO_REUSEPORT tests for old Linux and non-Linux stream_input: avoid IO#close on client disconnect t0300: kill off stray processes in test always write PID file early for compatibility doc: clarify SIGNALS and reference init example rework master-to-worker signaling to use a pipe
2013-12-09rework master-to-worker signaling to use a pipe
Signaling using normal kill(2) is preserved, but the master now prefers to signal workers using a pipe rather than kill(2). Non-graceful signals (:TERM/:KILL) are still sent using kill(2), as they ask for immediate shutdown. This change is necessary to avoid triggering the ubf (unblocking function) for rb_thread_call_without_gvl (and similar) functions extensions. Most notably, this fixes compatibility with newer versions of the 'pg' gem which will cancel a running DB query if signaled[1]. This also has the nice side-effect of allowing a premature master death (assuming preload_app didn't cause the master to spawn off rogue child daemons). Note: users should also refrain from using "killall" if using the 'pg' gem or something like it. Unfortunately, this increases FD usage in the master as the writable end of the pipe is preserved in the master. This limit the number of worker processes the master may run to the open file limit of the master process. Increasing the open file limit of the master process may be needed. However, the FD use on the workers is reduced by one as the internal self-pipe is no longer used. Thus, overall pipe allocation for the kernel remains unchanged. [1] - pg is correct to cancel a query, as it cannot know if the signal was for a) graceful unicorn shutdown or b) oh-noes-I-started-a-bad-query-ABORT-ABORT-ABORT!!
2013-11-26doc: clarify SIGNALS and reference init example
"interactive terminal" needed clarification. While we're at it, link to the init.sh example since it may be shared with nginx. Reported-by: Rodrigo Rosenfeld Rosas ref: <5294E9D4.5030608@gmail.com>
2013-11-26always write PID file early for compatibility
This reduces the window for a non-existent PID for folks who monitor PIDs (not a great idea anyways). Unfortunately, this change also brings us back to the case where having a PID later (for other process monitors) is beneficial but more unicorn releases exist where we write the PID early. Thanks to Jimmy Soho for reporting this issue. ref: <CAHStS5gFYcPBDxkVizAHrOeDKAkjT69kruFdgaY0CbB+vLbK8Q@mail.gmail.com> This partially reverts 7d6ac0c17eb29a00a5b74099dbb3d4d015999f27 Folks: please monitor your app with HTTP requests rather than checking processes, a stuck/wedged Ruby VM is still a running one.
2013-11-08t0300: kill off stray processes in test
We shouldn't leave processes running after the test.
2013-11-07stream_input: avoid IO#close on client disconnect
This can avoid IOError from being seen by the application, and also reduces points where IO#close may be called. This is a good thing if we eventually port this code into a low-level server like cmogstored where per-client memory space is defined by FD number of a client. Reported-by: Andrew Hobson <ahobson@gmail.com>
2013-11-04tests: fix SO_REUSEPORT tests for old Linux and non-Linux
On BSD-derived platforms the getsockopt true value may be any (>= 0) value, not just one as it is on Linux. Additionally, SO_REUSEPORT is only supported since Linux 3.9, so folks on older kernels may not have it available. We still define it for Linux since kernel upgrades are usually more common than glibc upgrades. Note: we will still raise an exception at runtime if a user explicitly requests :reuseport in their config and runs an older Linux kernel. Reported-by: Andrew Hobson <ahobson@gmail.com>
2013-11-04unicorn 4.7.0 - minor updates, license tweak v4.7.0
* support SO_REUSEPORT on new listeners (:reuseport) This allows users to start an independent instance of unicorn on a the same port as a running unicorn (as long as both instances use :reuseport). ref: https://lwn.net/Articles/542629/ * unicorn is now GPLv2-or-later and Ruby 1.8-licensed (instead of GPLv2-only, GPLv3-only, and Ruby 1.8-licensed) This changes nothing at the moment. Once the FSF publishes the next version of the GPL, users may choose the newer GPL version without the unicorn BDFL approving it. Two years ago when I got permission to add GPLv3 to the license options, I also got permission from all past contributors to approve future versions of the GPL. So now I'm approving all future versions of the GPL for use with unicorn. Reasoning below: 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. Note: we currently prefer GPLv3 Two improvements thanks to Ernest W. Durbin III: * USR2 redirects fixed for Ruby 1.8.6 (broken since 4.1.0) * unicorn(1) and unicorn_rails(1) enforces valid integer for -p/--port A few more odd, minor tweaks and fixes: * attempt to rename PID file when possible (on USR2) * workaround reopen atomicity issues for stdio vs non-stdio * improve handling of client-triggerable socket errors
2013-11-01bin/*: enforce -p/--port argument to be a valid integer
Users may confuse '-p' with the (to-be-deprecated) '-P/--pid' option, leading to surprising behavior if a pathname is passed as a port, because String#to_i would convert it to zero, causing: TCPServer.new(host, port = 0) to bind to a random, unused port.
2013-11-01construct listener_fds Hash in 1.8.6 compatible way
This renables the ability for Ruby 1.8.6 environments to perform reexecs [ew: clarified this is for 1.8.6, favor literal {} over Hash.new, tweaked LISTENERS.map => LISTENERS.each, thanks to Hleb Valoshka ] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-10-29configurator: validate :reuseport for boolean-ess
In case we (and Linux) supports other values in the future, we can update it then. Until now, ensure users only set true or false for this option.
2013-10-26license: 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.
2013-10-25http_server: fixup comments for PID file renaming
Thanks to Hongli Lai for noticing my typo. While we're at it, finish up a halfway-written comment for the EXDEV case
2013-10-25avoid IO_PURGATORY on Ruby 1.9+
Ruby 1.9 and later includes IO#autoclose=, so we can use it and prevent some dead IO objects from hanging around.