ChangeLog from git://git.bogomips.org/unicorn.git (v0.96.0..v0.97.0)
commit b1e90244af775cc6713a531f4194726e35df5379
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Mar 1 09:32:36 2010 +0000
unicorn 0.97.0 - polishing and cleaning up
A bunch of small fixes related to startup/configuration and hot
reload issues with HUP:
* Variables in the user-generated config.ru files no longer
risk clobbering variables used in laucher scripts.
* signal handlers are initialized before the pid file is
dropped, so over-eager firing of init scripts won't
mysteriously nuke a process.
* SIGHUP will return app to original state if an updated
config.ru fails to load due to {Syntax,Load}Error.
* unicorn_rails should be Rails 3 compatible out-of-the-box
('unicorn' works as always, and is recommended for Rails 3)
* unicorn_rails is finally "working_directory"-aware when
generating default temporary paths and pid file
* config.ru encoding is the application's default in 1.9,
not forced to binary like many parts of Unicorn.
* configurator learned to handle the "user" directive outside
of after_fork hook (which will always remain supported).
There are also various internal cleanups and possible speedups.
commit 39bdcadb986e3ca82a243ace90daee28c9d3f1e4
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Mar 1 18:25:08 2010 +0000
load the Etc module up front
It's part of the standard Ruby library and will always be loaded
by various modules (Rack::Utils, Tmpdir) so there's no point in
deferring it.
commit 45e89c0fed05396652bd3061b9b4f0814dc7d37d
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Mar 1 08:47:40 2010 +0000
configurator "user" directive outside of after_fork
Allowing the "user" directive outside of after_fork reduces the
cognitive overhead for folks that do not need the complexity of
*_fork hooks. Using Worker#user remains supported as it offers
fine-grained control of user switching.
commit e37d8d0c6355e48fd6d2627313b9003a160f27fc
Author: Eric Wong <normalperson@yhbt.net>
Date: Sun Feb 28 19:36:16 2010 -0800
bin/*: remove redundant $DEBUG check
commit a4a8bf7604d1c15c5a8fb9cb6be37e8bccb32e52
Author: Eric Wong <normalperson@yhbt.net>
Date: Sun Feb 28 19:20:11 2010 -0800
respect user's encoding in config.ru in 1.9
Do not assume the user wants config.ru to be Encoding::BINARY
for 1.9.
commit 947b8e5d312446b63a7dbd5be51a1bebf421cea8
Author: Eric Wong <normalperson@yhbt.net>
Date: Sun Feb 28 19:19:23 2010 -0800
unicorn_rails: small scoping cleanup
commit 706cc445863ff99d8605257a43e7bbd633c604c8
Author: Eric Wong <normalperson@yhbt.net>
Date: Sun Feb 28 18:48:59 2010 -0800
put switch parsing for config.ru into Unicorn.builder
This lets us reuse code for Zbatery and Rainbows!, too.
commit a31af29a22cb22072828391d8f421ccf6c59d9b5
Author: Eric Wong <normalperson@yhbt.net>
Date: Sat Feb 27 19:06:10 2010 -0800
tee_input: do not #dup string buffers
It's a waste of memory bandwidth to do memcpy() when we know
Unicorn::HttpParser (via rb_str_resize()) will allocate new
memory for the string for us. An empty String is "free",
as we've already paid the Object cost regardless.
commit a5f4d11cdb9465b1ffa2892b3d84ee53b8962930
Author: Eric Wong <normalperson@yhbt.net>
Date: Fri Feb 26 03:05:21 2010 -0800
tee_input: avoid instance variables, it's a struct
We'll use struct members exclusively from now on instead of
throwing ivars into the mix. This allows us to _unofficially_
support direct access to more members easily. Unofficial
extensions may include the ability to splice(2)/tee(2) for
better performance.
This also makes our object size smaller across all Ruby
implementations as well, too (helps Rainbows! out).
commit 4b4ac5ed5d62cab76790661ba92a9ac4d5f1c105
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 25 15:05:14 2010 -0800
unicorn_rails: make this "working_directory"-aware
The temporary paths we create to mimic script/server-emulation
did not work when working_directory was used. Now we defer
path creation until after working_directory is bound.
commit 036df6c373df6d7f52005fbbd3196646934329d3
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 25 14:56:26 2010 -0800
doc: clarify the intent of `unicorn_rails`
commit a057e63abb6f1deab6971eb84f95101133ffb65a
Author: Eric Wong <normalperson@yhbt.net>
Date: Wed Feb 24 18:21:07 2010 -0800
unicorn_rails: avoid namespace conflicts in config.ru
We'll use our Rails-only version of Unicorn.builder so
the lambda is safe without another binding.
commit 29661ccaaa03ab07f4de0d5c38f730f1d557b418
Author: Eric Wong <normalperson@yhbt.net>
Date: Wed Feb 24 15:35:42 2010 -0800
unicorn_rails: make this Rails 3-compatible
The stock config/boot.rb file in a Rails 3 app is much lighter
and does not export any Rails/RAILS_* constants, so we'll wait
until we get config/environment.rb loaded.
commit e8344fbf3af94f96b3a6467d6ddad176935f0017
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Feb 22 14:37:48 2010 -0800
util: simplify chown_logs
no point in using "next" here
commit 3b589335d56ab59aca6772b78eeb96335dc55455
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Feb 22 14:27:41 2010 -0800
avoid needlessly preallocating read buffer
Copy-on-write will always invalidate it regardless, and
the first request is likely to be slow for any app.
commit e5f6677627a55d49b72097e106d662d0149bfb05
Author: Eric Wong <normalperson@yhbt.net>
Date: Fri Feb 19 11:48:19 2010 -0800
update TODO
* Bourne shell - TAP test suite stolen from Rainbows!
* tests currently pass under FreeBSD 7.2
commit 6804e359cfc6b0d63a7337d2f1a92548bc3077f3
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 18 19:01:20 2010 -0800
.gitignore: add "*.o" object files
This was always in my .git/info/exclude so I never noticed
until now.
commit 2f43ec836def75285fa2e7ac6ef60595f1c36ce4
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 18 19:00:12 2010 -0800
http: document CFLAGS used for development
this file may be sourced and used later, too
commit ace625cfb1aa1b3c2f06890fb1f97900059bf226
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 18 18:53:03 2010 -0800
http: const correctness fixes
Not fun, but maybe this can help us spot _real_ problems
more easily in the future.
commit 4ee6275918cf15c1c380e0adc46e2516433d76fa
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 18 18:48:38 2010 -0800
http: cleanup globals and ABI namespace
* init_globals() is a static function, avoid conflicting
with any potential libraries out there...
* mUnicorn and cHttpParser do not need to be static globals
they're not used outside of Init_unicorn_http().
commit 4347b8987732b5bea83ddb8fb9605cf2c4a1c2fe
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 18 18:44:38 2010 -0800
http: avoid signedness warnings
We never come close to the signed limits anywhere, so it
should be safe either way, but make paranoid compiler settings
less noisy if possible.
commit 3e80ccb60e2b3632916094ac436806ab1cf03b11
Author: Eric Wong <normalperson@yhbt.net>
Date: Thu Feb 18 19:11:50 2010 -0800
Unicorn::builder to wrap our Rack::Builder usage
This should make it easier to reuse code in derivative
servers like Rainbows! and Zbatery. Unfortunately, we
can't depend on Rack::Builder/Rack::Server yet since
Rack 1.1 just got them and notable frameworks (like
Rails 2.3.x) do not fully work with Rack 1.1 yet).
This also fixes subtle issue with config.ru files that could
have variables that conflict with the Unicorn-specific
namespace (this bug still affects "unicorn_rails", which
could use some reworking as well).
commit 8963e87841501c8e79b8434f8887e0d3a78b580c
Author: Eric Wong <normalperson@yhbt.net>
Date: Wed Feb 17 19:24:09 2010 -0800
graceful handling of bad config.ru + HUP w/ preload_app
If preload_app is true and Unicorn is HUP-ed with a bad
config.ru, then it would be possible to have Unicorn in a bad
state and constantly throw 500 errors.
We now detect syntax and load errors since they're likely to
appear in modified Rackup files, and will restore the original
app if reloading failed.
commit ae0c39e09b27e953f41b2714c5d194a9e9a00da2
Author: Eric Wong <normalperson@yhbt.net>
Date: Wed Feb 17 19:23:10 2010 -0800
test-lib: don't croak if "error" is in the test name
commit 5cef71dc6c640db414c41f59a5016fd3f5326bf9
Author: Eric Wong <normalperson@yhbt.net>
Date: Wed Feb 17 18:53:52 2010 -0800
tests: import basic TAP library from Rainbows!
commit 13598f977ec3b707bd1a8f2abb99825cb8f85b58
Author: Eric Wong <normalperson@yhbt.net>
Date: Wed Feb 17 15:42:27 2010 -0800
GNUmakefile: remove old, lower-case variables
We started using upper-case variables a while back, so just
remove the backwards-compatibility clutter.
commit b30ae5c5f01c36f39b9c301e59d8ad9fb24f7c1b
Author: Eric Wong <normalperson@yhbt.net>
Date: Fri Feb 12 23:59:55 2010 -0800
http: fix memory leak exposed in concurrent servers
First off, this memory leak DOES NOT affect Unicorn itself.
Unicorn allocates the HttpParser once and always reuses it
in every sequential request.
This leak affects applications which repeatedly allocate a new
HTTP parser. Thus this bug affects _all_ deployments of
Rainbows! and Zbatery. These servers allocate a new parser for
every client connection.
I misread the Data_Make_Struct/Data_Wrap_Struct documentation
and ended up passing NULL as the "free" argument instead of -1,
causing the memory to never be freed.
From README.EXT in the MRI source which I misread:
> The free argument is the function to free the pointer
> allocation. If this is -1, the pointer will be just freed.
> The functions mark and free will be called from garbage
> collector.
commit 47c50ed7ebb2a97c2d289eede169f3e2e3f5e89b
Author: Eric Wong <normalperson@yhbt.net>
Date: Tue Feb 9 22:55:08 2010 -0800
reorder commonly accessed HttpServer struct members
Earlier elements of a Struct (in both Ruby and C) are faster
to access, so put more-often accessed elements like :app first.
This does not noticeably affect most applications, but may
matter to some micro benchmarks somewhere...
commit a7655b8f16f04d44ff422f3ca4eafcb5f0d3c0ca
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Feb 8 15:08:16 2010 -0800
test_http_parser_ng: remove redundant "coding: binary"
we've already got "-*- encoding: binary -*-" in everything
commit 6858d4ea7b4146ce96525fea821721e60cf6113f
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Feb 8 10:37:55 2010 -0800
examples/init.sh: add "reopen-logs" target
commit 8d36016c32d701b23cdfceb31aca493150b572a3
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Feb 8 10:35:01 2010 -0800
examples/init.sh: reenable set -u
This may be used as a basis of other scripts so we need
to stash $1 before we "set -u"
commit f5cbae120faf5f216e352f8a23184baf6029c72d
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Feb 8 10:32:27 2010 -0800
Rakefile: autoload rubygems
commit 813cdd3cbc35a86ebf33aaf028937e70a15ddba0
Author: Eric Wong <normalperson@yhbt.net>
Date: Mon Jan 25 18:07:52 2010 -0800
KNOWN_ISSUES: background threads + Logger monkey patch
Thanks to Michael Guterl for informing us of the issues
and testing the monkey patch.
commit cb6d8c71abac83d75d2bc990bdbc84748a1309ea
Author: Eric Wong <normalperson@yhbt.net>
Date: Tue Jan 19 18:09:30 2010 -0800
initialize signal handlers before writing pid file
This prevents trigger-happy init scripts from reading the pid
file (and thus sending signals) to a not-fully initialized
master process to handle them.
This does NOT fix anything if other processes are sending
signals prematurely without relying on the presence of the pid
file. It's not possible to prevent all cases of this in one
process, even in a purely C application, so we won't bother
trying.
We continue to always defer signal handling to the main loop
anyways, and signals sent to the master process will be
deferred/ignored until Unicorn::HttpServer#join is run.
commit af637c8c64636a97c468e9126dfdc4575d1826aa
Author: Eric Wong <normalperson@yhbt.net>
Date: Tue Jan 19 17:58:01 2010 -0800
remove unused MAX_HEADER constant
This constant hasn't been in active use in our Ruby code for
ages now. All HTTP header constraints are defined in the
C/Ragel HTTP parser and we have tests for them, so there's
no need to repeat ourselves.
commit 00ff46894fa71278b11ef689f463d5c88752bda2
Author: Eric Wong <normalperson@yhbt.net>
Date: Tue Jan 19 17:52:33 2010 -0800
bump version to 0.97.0pre
There may be some large-ish internal changes for 0.97.0
commit 8bbcb4c7e4b11f0e191e5ffc4b56c083029e34c0
Author: Eric Wong <normalperson@yhbt.net>
Date: Tue Jan 19 18:30:36 2010 -0800
TODO: test suite passes under FreeBSD
commit 46bbf948ce935cbb72c33cd62fe721ce94530fb2
Author: Eric Wong <normalperson@yhbt.net>
Date: Tue Jan 19 13:55:35 2010 -0800
FAQ entry for Rails 2.3.x + Rack 1.1.x incompatibility
Generated with the Darkfish Rdoc Generator 1.1.6.