about summary refs log tree commit homepage
DateCommit message (Collapse)
2009-04-16unicorn 0.5.2 v0.5.2
2009-04-16unicorn/const: kill trailing whitespace
Trailing whitespace glows *RED* every time I open this file to edit a constant and that annoys me.
2009-04-16GNUmakefile: small dependency cleanups
2009-04-16test: fix dependency issue with "make test-unit"
The $(test_prefix)/.stamp file must be a dependency of the parent make process otherwise the slow %.n children won't be able to communicate the dependency up to the other non-slow tests.
2009-04-16ensure responses always have the "Status:" header
There are weird (and possibly broken) clients out there that require it despite being present in the first line of the response. So be nice and accomodate them. Keep in mind that the Rack SPEC explicitly forbids this header from being in the headers returned by the Rack-based application; so we have to always inject it ourselves and ignore it if the application sets it.
2009-04-15http11: default server port is 443 for https
Also, some minor cleanups and branch refactoring.
2009-04-15worker_loop cleanups, var golf, and yak-shaving
Ensure we always fchmod our tempfile in case of client error to avoid getting nuked in the next request cycle. Also, kill off some unnecessary variables since this method has too many variables anyways and we can overload the "nr" counter to do what "accepted" and "reopen_logs" did..
2009-04-15before_commit and before_exec can never be nil/false
So don't bother checking them again. Configurator already ensures that they're Proc objects for us, and we've been forgetting to check @before_fork since the beginning of time anyways... Consistency + less code = good
2009-04-14s/rotating/reopening/g in log messages
We don't (and won't ever) do log rotation within the process. That's the job of logrotate and tools like that. We just reopen logs like other reasonable daemons out there.
2009-04-14Explicitly trap SIGINT/SIGTERM again
Otherwise we get generally worthless backtraces and we don't want to clobber those for other signals, either.
2009-04-13unicorn 0.5.1 v0.5.1
2009-04-13Fix SIGINT/SIGTERM handling (broken in 0.5.0)
By reraising SignalException in workers. Since we just rely on default signal handlers for the majority of signals now, ensure those signals actually exit the process.
2009-04-13unicorn 0.5.0 v0.5.0
2009-04-13Configurator: add example for user/group switching
I don't advocate running Unicorn on unprivileged ports anyways since Unicorn should never be exposed directly to public clients.
2009-04-13Expose worker to {before,after}_fork hooks
Instead of just worker.nr. This is a configuration file/API change and will break existing configurations. This allows worker.tempfile to be exposed to the hooks so ownership changes can still happen on it. On the other hand, I don't know of many people actually using this feature (or Unicorn).
2009-04-13Remove unnecessary local variables in process_client
I'm golfing, really, but maybe we can be 0.00001% faster if we avoid naming some variables...
2009-04-13small cleanups in signal handling and worker init
Since signals and signal handlers are process-wide, just make SIG_QUEUE a global constant since there's absolutely no reason it should be otherwise... Restore default signal handlers when building app in case our app does anything strange or gets hung, it's nice to know SIG{INT,TERM} can be used to kill it while it's loading. Additionally, there's little point in clearing arrays before nilling them: just trust the GC to do its job properly.
2009-04-12old_rails: try harder to ensure valid responses
Hopefully the world will just move to Rack faster so we have less things to worry about.
2009-04-12Don't bother restoring ENV or umask across reexec
If someone changes ENV or umask in the master process (via before_fork or when loading the config), assume it was intentional and just preserve it across reexec.
2009-04-12Remove unnecessary sync assignment
We never write to the file anyways, and fchmod is never buffered
2009-04-12Save one fcntl() syscall on every request
MRI 1.8 always sets O_NONBLOCK on sockets to implement green threads correctly in the face of slow network I/O. Since we already know what the I/O flags for a client socket should be, we just set it to that instead. Applications running on Unicorn continue to be green thread-safe when used fast local traffic. Of course, Unicorn itself will never use threads.
2009-04-12test_http_parser: fix broken URL in comment
This was back when I did s/mongrel/Unicorn/g on the sources.
2009-04-12test_exec: fix potential races in fd leak test
We need to ensure children are spawned by waiting until the master is ready.
2009-04-12http11: cleanup+safer rack.url_scheme handling
Avoid using strcmp() since it could break badly if Ruby ever stopped null-terminating strings C-style. We're also freezing "http" as a global. Rack does not explicitly permit nor deny this, and Mongrel has always used frozen strings as hash values in other places.
2009-04-11Remove _all_ non-POSIX socket options
Unicorn is strictly for fast LAN and localhost clients. Unicorn is not for slow, high-latency or trickling clients and cannot do keepalive or pipelining. None of the removed options actually make sense in the environment Unicorn was designed for. * DEFER_ACCEPT/ACCEPT_FILTER - these are useful for mitigating connect() floods or trickling clients. We shouldn't have to deal with those on a trusted LAN. * TCP_CORK/TCP_NODELAY - we only send output in the response and then immediately close the socket. Assuming the typical response containing a small header and large strings in the body: the Nagle algorithm would've corked the headers regardless and any pending output would be immediately flushed when the socket is closed immediately after sending. These options would still be useful from the client-side on the LAN, or if Unicorn supported keepalive. Of course, I highly recommend enabling all of these options you can possibly enable on nginx or another fully-buffering reverse proxy when dealing with slow clients.
2009-04-10listen backlog, sndbuf, rcvbuf are always changeable
Apparently I was smoking crack and thought they weren't changeable. Additionally, SO_REUSEADDR is set by TCPServer.new, so there's no need to set it ourselves; so avoid putting extra items in the purgatory. This allows SIGHUP to change listen options.
2009-04-10Restore unlinked UNIX sockets on SIGHUP
Sockets may be unintentionally unlinked on the filesystem. When reloading our config, ensure that the socket exists on the filesystem. If not, close the listener (since it's unusable by outside apps) and reopen it.
2009-04-10README: doc updates
Given the amount of changes we've made to Mongrel, "Solid Mongrel code base" doesn't seem appropriate. Also try to clarify a few wording issues.
2009-04-10config: handle listener unbind/replace in config file
Rather than blindly appending to our listener set with every "listen" directive read in the config file, reset our internal array. Listeners specified on the command-line are always preserved between config reloads.
2009-04-10close listeners when removing them from our array
This fixes a long-standing bug where listeners would be removed from the known listener set during a reload but never correctly shut down (until reexec). Additionally, test_server was working around this bug (my fault, subconciously) as teardown did not unbind the socket, requiring the tests to grab a new port.
2009-04-08http11: handle "X-Forwarded-Proto: https"
Pass "https" to "rack.url_scheme" if the X-Forwarded-Proto header matches "https". X-Forwarded-Proto is a semi-standard header that Ruby frameworks seem to respect; so we use that. We won't support ENV['HTTPS'] since that can only be set at start time and some app servers supporting https also support http. Currently, "rack.url_scheme" only allows "http" and "https", so we won't set anything else to avoid breaking Rack::Lint.
2009-04-08http11: Remove qsort/bsearch code paths
The build-time complexity was not worth the minor performance improvement we could get for the average case (and we can cut down the amount of comparisons by putting frequent/required headers first).
2009-04-08test_request: tests esoteric/rare REQUEST_URIs
* Test for '*' in "OPTIONS * HTTP/1.1" for now (even though Rack doesn't like it). * Some clients can send absolute URIs, too
2009-04-07cleanup some log messages
* no need to show PID of process writing the logs, the default log formatter already includes it * Don't bother displaying classes of listeners, the address themselves should be enough.
2009-04-05test_configurator: rename test name that never ran
Run tests with warnings so we detect stupid things like this.
2009-04-05GNUmakefile: allow "make V=1 ..." for verbosity
As usual, spit out all the test output if something fails. But allow people who like to see things scroll by see things scroll by. Quiet down the Rails tests by default, too.
2009-04-05GNUmakefile: remove unnecessary asterisks in output
It was wrapping in my 80 column terminal when prefixed with some text.
2009-04-05Add test for :preload_app config option
2009-04-05local.mk: touch files after set-file-times
Avoid breaking builds just in case. set-file-times is just for the benefit of rdoc displaying modification time information in HTML pages.
2009-04-05Enforce umask 0000 with UNIX domain sockets
I can't think of a good reason to ever use restrictive permissions with UNIX domain sockets for an HTTP server. Since some folks run their nginx on port 80 and then have it drop permissions, we need to ensure our socket is readable and writable across the board. The reason I'm respecting the existing umask at all (instead of using 0000 across the board like most daemonizers) is because the admin may want to restrict access (especially write access) to log files.
2009-04-03Documentation updates
Reword and expand a bit
2009-04-03Add a test for signal recovery
I/O on slow descriptors can be interrupted so make sure we (and Ruby itself) are handling EINTR correctly.
2009-04-03configurator: allow hooks to be passed callable objects
Premade lambda/proc/Proc objects may all be passed, to the hooks, not just anonymous blocks.
2009-04-03test_helper: redirect_io uses append and sync
In case redirect_io is called multiple times, we don't want to lose debugging output.
2009-04-02unicorn 0.4.2 v0.4.2
2009-04-02GNUmakefile: "install" preserves unicorn_rails
This is to prevent the shebang line from being clobbered by setup.rb which does the rest of the heavy lifting. While we're at it, remove the dependency on git, too.
2009-04-02unicorn: remove unnecessary lambda generation
We can get by with one less lambda in the loader
2009-04-02Add log directories to tests
Not sure if unicorn_rails should create them since the builtin Rails server only creates things under tmp/*.
2009-04-02Use File.basename instead of a regexp
Just because I know regular expressions doesn't mean I *have* to use them...
2009-04-02test/rails: v2.1.2 + ActiveRecordStore all around
Recent changes made to the unicorn_rails loader were needed to get ActiveRecordStore to load correctly.