about summary refs log tree commit homepage
DateCommit message (Collapse)
2009-03-04Ensure reopened std{out,err}_paths can be rotated
The $stderr/$stdout objects need to point to +File+ objects and mot just +IO+ objects they default to for reopen_logs to work.
2009-03-03unicorn/http11: hopefully fix gem installation
Also, update the Manifest
2009-03-03test_exec: remove extraneous fcntl require
There used to be a log rotation lambda in there, but that got moved to lib/unicorn/util.rb for convenience.
2009-03-03configurator: update the per-worker listen example
The config file format changed from add_listener => listen.
2009-03-03require Rack as late as possible in execution
This allows LOAD_PATH modifications via the command-line (via -I or -rubygems on the command-line).
2009-03-03Raise ArgumentError if listeners are empty
Instead of blindly trying to bind to the default listener (which is already the default as specified by Configurator).
2009-03-03Add configurator test
2009-03-03fix typo (DEFAULT_LISTENER => DEFAULT_LISTEN)
2009-03-03Allow stderr_path and stdout_path to be set in the config
As opposed to doing this in the shell, this allows the files to be reopened reliably after rotation. While we're at it, use $stderr/$stdout instead of STDERR/STDOUT since they seem to be more favored.
2009-03-03Load the app _after_ forking workers by default
This means processes will share less memory but things should be compatible with all existing setups.
2009-03-03Rakefile: remove unused move_extensions code
2009-03-03Handle Errno::EINTR during IO.select in workers
If we get woken up during an IO.select, just make a bet that we spent some time doing something else and aggressively try to accept new connections without trying to wait for I/O-readiness notification.
2009-03-03Make USR1 rotate log files by default
I consider it a sensible default for long-running servers. Additionally, there is no easy way to make USR1 rotate the master process log without this.
2009-03-03Add Unicorn::Util for a reopen_logs method
Since I use it myself and also in the tests, we might as well implement it correctly as a class method so people can run it in their trap('USR2') hooks.
2009-03-03symlink-aware start_ctx[:cwd]
Using `/bin/sh -c pwd` here instead of Dir.pwd since the pwd shell builtin is symlink-aware if ENV['PWD'] is correct (and it is when launched via Cap). Also, correctly use @directory if it is set.
2009-03-03Unlink the pid file explicitly when master exits
Relying on at_exit can still means a child might get it if there's any race condition....
2009-03-03test_exec: avoid mis-teardown just in case...
Probably not a real bug, but test_exec has been experiencing mysterious failures....
2009-03-03Begin to allow deferred app creation/loading
Some applications do not handle loading before forking out-of-the-box very gracefully, this starts adding support to build the Rack(-ish) application later in the process.
2009-03-03test_exec: avoid hiding error when binary can't be found
Oops, that was making debugging tests quite difficult.
2009-03-03Remove unnecessary separators in help text
Doesn't seem to make a difference for 1.8 but shows up in 1.9...
2009-03-03Remove -P/--pid switch from CLI
It's confusing with the lowercase "-p" option which is more common for developers to use. PID files are only needed for production deployments, and those should be using config files anyways.
2009-03-03test_exec: higher timeouts for log reading
Yeah, some of my test machines are ridiculously slow...
2009-03-03test_exec: be more liberal regarding terminal output
23x79 looks better in a terminal, but the Ruby 1.9 OptionParser output adds a little more whitespace requiring 24x80 output, which is still fine...
2009-03-03test/exec: avoid letting child processes unlink tempfiles
Hopefully this fixes some random test failures I've been experiencing...
2009-03-03test for "unicorn --help" output
Ensure the output fits in a standard ANSI terminal so it's easy to read for all users regardless of what interface they're working from.
2009-03-03exec: disable embedded switch parsing in config.ru
Since not all rackup command-line options can be supported by Unicorn, disable this gross hack to avoid potentially unpredictable or undefined behavior. config.ru will not be able to specify the config file for unicorn-specific options; but the unicorn-specific config files themselves will be allowed to override the default config.ru location.
2009-03-03test_exec: simplify check for unicorn binary
2009-03-03test/aggregate: remove Ruby version from output
This was accidentally left in there during 1.9 compatibility testing.
2009-03-03.gitignore: updates to be more flexible
Just use globs for *.o/*.so/*.bundle files since there's never any reason they should be checked into version control.
2009-02-25rename http11 => unicorn/http11
Avoid conflicting with existing (and future) Mongrel installs in case either changes. Of course, this also allows us more freedom to experiment and break the API if needed... However, I'm only planning on making minor changes to remove the amount of C code we have to maintain and possibly some minor performance improvements.
2009-02-23Update Manifest
2009-02-23Allow overriding :directory or via -C/--directory
This allows Unicorn to be constantly started in symlink paths such as the ones Capistrano creates (e.g. "/u/apps/$app/current")
2009-02-21Fix+test reexec error handling on bad inputs
People can screw config files up, it's not my fault if they do, but they do... Don't let the original process get wedged if we can help it..
2009-02-21test_exec: fix for temporary files not being cleaned
Apparently the at_exit handlers were not triggering for an execed process.
2009-02-21GNUMakefile: revamp for parallel 1.8/1.9 runs
Add a install-test for doing a mock install with private http11 and bin/unicorn and appropriate PATH/RUBYLIB env. Also add a normal install target so we can just type "make install" and just be done with a regular installation (and it'll revert files if using git). I use the following local.mk to augment my GNUmakefile. It allows me to run "make -j full-test" and run both 1.8 and 1.9 tests in parallel. --------------------------- 8< ------------------------- DLEXT := so rack_ver := 0.9.1 ifeq ($(r19),) ruby := $(HOME)/bin/ruby RUBYLIB := $(HOME)/lib/ruby/gems/1.8/gems/rack-$(rack_ver)/lib else export PATH := $(HOME)/ruby-1.9/bin:$(PATH) ruby := $(HOME)/ruby-1.9/bin/ruby RUBYLIB := $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/rack-$(rack_ver)/lib endif SHELL := /bin/bash -e -o pipefail full-test: test-18 test-19 test-18: $(MAKE) test 2>&1 | sed -u -e 's!^!1.8 !' test-19: $(MAKE) test r19=1 2>&1 | sed -u -e 's!^!1.9 !' --------------------------- 8< -------------------------
2009-02-21Replace unicorn binary with something rackup-like
This adds a bunch of execution tests that require the "unicorn" binary to be in PATH as well as rack being directly "require"-able ("rubygems" will not be loaded for you). The tester is responsible for setting up PATH and RUBYLIB appropriately.
2009-02-21revamp configuration with Configurator DSL
The Configurator includes error checking and opens the way for better reloading/error-checking abilities. This also renames many of the config settings with something nginx-like to minimize the learning/setup curve since nginx is the only recommended reverse-proxy for this. s/pid_file/pid/ => blech!, more confusing :< s/listen_backlog/backlog/ => maybe more confusing to some, or less... s/nr_workers/worker_processes/ => less confusing to non-AWKers for sure s/hot_config_file/config_file/ => the config file is now general purpose, not just hot reloads
2009-02-21Register default constants in Const module
This will make setting some of this easier to deal with in the executable.
2009-02-21Ignore ENV['PWD'] in default start context
This variable is not guaranteed to be updated outside of an interactive POSIX-ish shell.
2009-02-21socket: make bind_listen idempotent, really
2009-02-21.gitignore: add doc
2009-02-21test_helper: cleanup requires
We don't need these dependencies slowing down load times on our tests..
2009-02-20test_upload: trap EPIPE if a connection shuts us down, too
Reset connections can also return EPIPE under Linux, not just ECONNRESET; so be sure to trap that error, too.
2009-02-20test_upload: close urandom fd at teardown
Prevent the GC from trying to close it (and hitting the wrong descriptor) when @random is reopened for running tests.
2009-02-20http11: set SERVER_NAME env regardless of Host: header
The Rack spec requires it. So we'll just set it to "localhost" if we're dealing with HTTP/1.0 clients that omit the "Host:" header.
2009-02-19http11: don't bother defining SERVER_SOFTWARE
It was mistakenly set to false before, which breaks Rack::Lint. As the Rack SPEC doesn't require it, don't bother setting it at all and save a few bytes of memory.
2009-02-14HttpResponse: remove crack-addled HTTP_STATUS_HEADERS hash
This also fixes a subtle bug in header generation when the +$,+ ($OFS) variable is defined to something other than nil or "" I'm really wondering what kind of drugs I was on (or _not_ on) when I modified some of this from the Mongrel source.
2009-02-13HttpResponse: use each instead of each_pair to iterate
Rack spec specifies #each must be defined, not #each_pair. Hash#each_pair was marginally faster in Ruby 1.8, but in Ruby 1.9.1, Hash#each and Hash#each_pair are the same function.
2009-02-13continue ignoring SIGCHLD for now...
Since dying children can be a sign that something is wrong with the app itself, continue to use the 1 wakeup/sec throttle and don't wake the master immediately.
2009-02-13trap SIGCHLD and wakeup master on it
And avoid repeatedly sending kill -0 to each worker, that nugget of stupid probably slipped in while I was testing something...