about summary refs log tree commit homepage
DateCommit message (Collapse)
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...
2009-02-13README: finish half-written sentence/paragraph
2009-02-13test_upload: fix rename under 1.8
Ruby 1.9 Tempfile objects can be passed directly to File.rename (instead of the pathname). This doesn't work in 1.8, so always just pass the pathname to File.rename.
2009-02-13Remove tempfile reuse from HttpRequest, upload tests
Tempfile reuse was over-engineered and the problem was not nearly as big a problem as initially thought. Additionally, it could lead to a subtle bug in an applications that link(2)s or rename(2)s the temporary file to a permanent location _without_ closing it after the request is done. Applications that suffer from the problem of directory bloat are still free to modify ENV['TMPDIR'] to influence the creation of Tempfiles.
2009-02-13tests: replace process_based_port with unused_port
unused_port is more reliable as it actually tries to bind a port and retries if it fails. This is also safe across parallel unicorn tests running in different directories.
2009-02-11Update documentation
2009-02-11Add Sinatra example
2009-02-10add_listener logging includes fd= information
This is to make things consistent with the other logging when adding listeners
2009-02-10setup.rb friendliness
2009-02-10Set default process title
This can be overridden in {after,before}_fork hooks of course; but makes things look a little nicer.
2009-02-10Add *.log and pkg/ to .gitignore
2009-02-10Update Manifest
Add a make task for updating it, too.
2009-02-10add hot_config_file config parameter
This allows changing certain variables without restarting the master process or code reload. Currently, only the following variables are supported: @timeout, @nr_workers, @hot_config_file. Any other config changes will/should require re-executing the running binary. This config file is run through eval(); so it really users plenty of rope to hang themselves with. Of course, it requires valid Ruby syntax: ------------------------- 8< ------------------------ @nr_workers = 8 @timeout = 15 @hot_config_file = "/var/tmp/new_hot_config_file" ------------------------- 8< ------------------------ Lowering the timeout will trigger all existing workers to be gracefully stopped and restarted. This file is loaded at startup, and overrides any config settings that may already be loaded.
2009-02-10Allow listen_backlog to be specified in config.
This controls the backlog argument to the listen(2) system call. See your operating system documentation for listen(2) on the specifics of this option. The default is 1024, which is the same as Mongrel. 5 is the default for Ruby TCPServer and UNIXServer; and in some case it can be better where failover to a different machine/cluster is properly configured.
2009-02-10update README
2009-02-10Minor and insignificant cleanups and style changes
* IO.pipe.map { } looks moronic, especially without doing more inside it (like setting set_cloexec). * No need to sleep when we have an unhandled master loop exception (save for paranoia). * client.class == TCPSocket is slightly more expensive than TCPSocket === client * nilify client to avoid GC from trying to close it * Process.kill => kill
2009-02-09Use a short-as-possible path for worker Tempfiles
These files are unlinked immediately anyways, so it's wasteful to give them a long name...
2009-02-09Prevent leakage of private pipes and tempfiles.
Don't rely on FD_CLOEXEC if we don't have to since it may not be completely portable. Just explicitly close things (pipes, tempfiles) we don't want to pass on to our children when forking.
2009-02-09add add_listener method for use in configs
This makes it possible to bind per-process listener ports for easier debugging. One of my biggest gripes about other prefork webservers is that strace-ing the correct process for debugging is difficult. This makes it possible for each worker to bind to a unique port or UNIX socket independent of the other workers.
2009-02-09Delete UNICORN_* environment variables in workers
Workers have no business knowing these things...
2009-02-09daemonization by setting UNICORN_DAEMONIZE env
Daemonization only happens once at initial startup and is less intrusive than traditional daemonize routines: we do not chdir, set umask, or redirect/close STDOUT/STDERR since those are doable via other config options with Unicorn (and the Unicorn "config file" is just Ruby). STDIN has no business being open on a daemon (and can be dangerous to close if using certain buggy third-party libs).
2009-02-09Avoid starting the pipe until we need it
If we're running in the foreground and don't care for process manglement, then there's no need to start a pipe we won't need.
2009-02-09Add optional PID file support
Like nginx, we'll replace the existing "pid_file" with "pid_file.oldbin" when executing a new binary. We'll also refuse to reexecute a new binary if the ".oldbin" pid file already exists and points to a valid PID.