Date | Commit message (Collapse) |
|
The $stderr/$stdout objects need to point to +File+ objects
and mot just +IO+ objects they default to for reopen_logs
to work.
|
|
Also, update the Manifest
|
|
There used to be a log rotation lambda in there, but
that got moved to lib/unicorn/util.rb for convenience.
|
|
The config file format changed from add_listener => listen.
|
|
This allows LOAD_PATH modifications via the command-line
(via -I or -rubygems on the command-line).
|
|
Instead of blindly trying to bind to the default listener
(which is already the default as specified by Configurator).
|
|
|
|
|
|
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.
|
|
This means processes will share less memory but things
should be compatible with all existing setups.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Relying on at_exit can still means a child might get it
if there's any race condition....
|
|
Probably not a real bug, but test_exec has been experiencing
mysterious failures....
|
|
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.
|
|
Oops, that was making debugging tests quite difficult.
|
|
Doesn't seem to make a difference for 1.8
but shows up in 1.9...
|
|
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.
|
|
Yeah, some of my test machines are ridiculously slow...
|
|
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...
|
|
Hopefully this fixes some random test failures I've
been experiencing...
|
|
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.
|
|
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.
|
|
|
|
This was accidentally left in there during 1.9
compatibility testing.
|
|
Just use globs for *.o/*.so/*.bundle files since there's never
any reason they should be checked into version control.
|
|
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.
|
|
|
|
This allows Unicorn to be constantly started in symlink
paths such as the ones Capistrano creates
(e.g. "/u/apps/$app/current")
|
|
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..
|
|
Apparently the at_exit handlers were not triggering for an
execed process.
|
|
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< -------------------------
|
|
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.
|
|
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
|
|
This will make setting some of this easier to deal
with in the executable.
|
|
This variable is not guaranteed to be updated outside
of an interactive POSIX-ish shell.
|
|
|
|
|
|
We don't need these dependencies slowing down load times
on our tests..
|
|
Reset connections can also return EPIPE under Linux, not just
ECONNRESET; so be sure to trap that error, too.
|
|
Prevent the GC from trying to close it (and hitting the wrong
descriptor) when @random is reopened for running tests.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
And avoid repeatedly sending kill -0 to each worker,
that nugget of stupid probably slipped in while I was
testing something...
|