Files | Admin

Notes:

Release Name: 4.4.0

Notes:
unicorn 4.4.0 - minor updates

Unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels.  Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between Unicorn and slow clients.

* http://unicorn.bogomips.org/
* mongrel-unicorn@rubyforge.org
* git://bogomips.org/unicorn.git
* http://unicorn.bogomips.org/NEWS.atom.xml

Changes:

Non-regular files are no longer reopened on SIGUSR1.  This
allows users to specify FIFOs as log destinations.

TCP_NOPUSH/TCP_CORK is no longer set/unset by default.  Use
:tcp_nopush explicitly with the "listen" directive if you wish
to enable TCP_NOPUSH/TCP_CORK.

Listen sockets are now bound _after_ loading the application for
preload_app(true) users.  This prevents load balancers from
sending traffic to an application server while the application
is still loading.

There are also minor test suite cleanups.



Changes: GIT-VERSION-GEN | 2 +- GNUmakefile | 31 +-- lib/unicorn.rb | 2 +- lib/unicorn/const.rb | 2 +- lib/unicorn/http_server.rb | 13 +- lib/unicorn/socket_helper.rb | 14 +- lib/unicorn/util.rb | 1 + script/isolate_for_tests | 18 -- t/listener_names.ru | 4 + t/rails3-app/.gitignore | 4 - t/rails3-app/Gemfile | 26 -- t/rails3-app/Rakefile | 10 - .../app/controllers/application_controller.rb | 4 - t/rails3-app/app/helpers/application_helper.rb | 2 - .../app/views/layouts/application.html.erb | 14 - t/rails3-app/config.ru | 4 - t/rails3-app/config/application.rb | 46 ---- t/rails3-app/config/boot.rb | 6 - t/rails3-app/config/database.yml | 22 -- t/rails3-app/config/environment.rb | 5 - t/rails3-app/config/environments/development.rb | 19 -- t/rails3-app/config/environments/production.rb | 42 --- t/rails3-app/config/environments/test.rb | 32 --- .../config/initializers/backtrace_silencers.rb | 7 - t/rails3-app/config/initializers/inflections.rb | 10 - t/rails3-app/config/initializers/mime_types.rb | 5 - t/rails3-app/config/initializers/secret_token.rb | 7 - t/rails3-app/config/initializers/session_store.rb | 8 - t/rails3-app/config/locales/en.yml | 5 - t/rails3-app/config/routes.rb | 58 ----- t/rails3-app/db/seeds.rb | 7 - t/rails3-app/doc/README_FOR_APP | 2 - t/rails3-app/public/404.html | 1 - t/rails3-app/public/500.html | 1 - t/rails3-app/public/x.txt | 1 - t/rails3-app/script/rails | 9 - t/rails3-app/test/performance/browsing_test.rb | 9 - t/rails3-app/test/test_helper.rb | 13 - t/t0022-listener_names-preload_app.sh | 32 +++ t/t0300-rails3-basic.sh | 28 -- t/t0301-rails3-missing-config-ru.sh | 33 --- t/t0302-rails3-alt-working_directory.sh | 32 --- t/t0303-rails3-alt-working_directory_config.ru.sh | 56 ---- ...04-rails3-alt-working_directory_no_embed_cli.sh | 52 ---- t/test-rails3.sh | 27 -- test/exec/test_exec.rb | 158 ++++++------ test/rails/app-1.2.3/.gitignore | 2 - test/rails/app-1.2.3/Rakefile | 7 - .../rails/app-1.2.3/app/controllers/application.rb | 6 - .../app-1.2.3/app/controllers/foo_controller.rb | 36 --- .../app-1.2.3/app/helpers/application_helper.rb | 4 - test/rails/app-1.2.3/config/boot.rb | 11 - test/rails/app-1.2.3/config/database.yml | 12 - test/rails/app-1.2.3/config/environment.rb | 13 - .../app-1.2.3/config/environments/development.rb | 9 - .../app-1.2.3/config/environments/production.rb | 5 - test/rails/app-1.2.3/config/routes.rb | 6 - test/rails/app-1.2.3/log/.gitignore | 1 - test/rails/app-1.2.3/public/404.html | 1 - test/rails/app-1.2.3/public/500.html | 1 - test/rails/app-2.0.2/.gitignore | 2 - test/rails/app-2.0.2/Rakefile | 7 - .../rails/app-2.0.2/app/controllers/application.rb | 4 - .../app-2.0.2/app/controllers/foo_controller.rb | 36 --- .../app-2.0.2/app/helpers/application_helper.rb | 4 - test/rails/app-2.0.2/config/boot.rb | 11 - test/rails/app-2.0.2/config/database.yml | 12 - test/rails/app-2.0.2/config/environment.rb | 17 -- .../app-2.0.2/config/environments/development.rb | 8 - .../app-2.0.2/config/environments/production.rb | 5 - test/rails/app-2.0.2/config/routes.rb | 6 - test/rails/app-2.0.2/log/.gitignore | 1 - test/rails/app-2.0.2/public/404.html | 1 - test/rails/app-2.0.2/public/500.html | 1 - test/rails/app-2.1.2/.gitignore | 2 - test/rails/app-2.1.2/Rakefile | 7 - .../rails/app-2.1.2/app/controllers/application.rb | 4 - .../app-2.1.2/app/controllers/foo_controller.rb | 36 --- .../app-2.1.2/app/helpers/application_helper.rb | 4 - test/rails/app-2.1.2/config/boot.rb | 111 -------- test/rails/app-2.1.2/config/database.yml | 12 - test/rails/app-2.1.2/config/environment.rb | 17 -- .../app-2.1.2/config/environments/development.rb | 7 - .../app-2.1.2/config/environments/production.rb | 5 - test/rails/app-2.1.2/config/routes.rb | 6 - test/rails/app-2.1.2/log/.gitignore | 1 - test/rails/app-2.1.2/public/404.html | 1 - test/rails/app-2.1.2/public/500.html | 1 - test/rails/app-2.2.2/.gitignore | 2 - test/rails/app-2.2.2/Rakefile | 7 - .../rails/app-2.2.2/app/controllers/application.rb | 4 - .../app-2.2.2/app/controllers/foo_controller.rb | 36 --- .../app-2.2.2/app/helpers/application_helper.rb | 4 - test/rails/app-2.2.2/config/boot.rb | 111 -------- test/rails/app-2.2.2/config/database.yml | 12 - test/rails/app-2.2.2/config/environment.rb | 17 -- .../app-2.2.2/config/environments/development.rb | 7 - .../app-2.2.2/config/environments/production.rb | 5 - test/rails/app-2.2.2/config/routes.rb | 6 - test/rails/app-2.2.2/log/.gitignore | 1 - test/rails/app-2.2.2/public/404.html | 1 - test/rails/app-2.2.2/public/500.html | 1 - test/rails/test_rails.rb | 287 --------------------- test/unit/test_util.rb | 15 +- 104 files changed, 140 insertions(+), 1703 deletions(-) commit f0a31e43676f59762d5bf53707cd8cc21fed0727 Author: Eric Wong Date: Wed Oct 10 21:33:46 2012 +0000 unicorn 4.4.0 - minor updates Non-regular files are no longer reopened on SIGUSR1. This allows users to specify FIFOs as log destinations. TCP_NOPUSH/TCP_CORK is no longer set/unset by default. Use :tcp_nopush explicitly with the "listen" directive if you wish to enable TCP_NOPUSH/TCP_CORK. Listen sockets are now bound _after_ loading the application for preload_app(true) users. This prevents load balancers from sending traffic to an application server while the application is still loading. There are also minor test suite cleanups. commit 032791b9a367f67febbe7534f6ea4cac127e7897 Author: Eric Wong Date: Mon Oct 1 21:18:02 2012 -0700 util: only consider regular files as logs If a user specifies a non-regular file for stderr_path or stdout_path, we should not attempt to reopen or chown it. This should also allow users to specify FIFOs as log destinations. commit 5acf5522295c947d3118926d1a1077007f615de9 Author: Eric Wong Date: Mon Aug 6 13:34:34 2012 -0700 avoid assert_nothing_raised in unit tests It's better to show errors and backtraces when stuff breaks commit 7b107d66e84ad2e958d5574cb00770265dd117c2 Author: Eric Wong Date: Mon Aug 6 20:15:46 2012 +0000 do not touch TCP_NOPUSH/TCP_CORK at all by default On a certain FreeBSD 8.1 installation, explicitly setting TCP_NOPUSH to zero (off) can cause EADDRNOTAVAIL errors and also resets the listen backlog to 5. Enabling TCP_NOPUSH explicitly did not exhibit this issue for the user who (privately) reported this issue. To be on the safe side, we won't set/unset TCP_NOPUSH/TCP_CORK at all, which will leave it off on all current systems. commit 53c375dc933b62b24df2c54d3938b03fa9da1f06 Author: Eric Wong Date: Fri Jun 29 16:22:17 2012 -0700 bind listeners after loading for preload_app users In the case where preload_app is true, delay binding new listeners until after loading the application. Some applications have very long load times (especially Rails apps with Ruby 1.9.2). Binding listeners early may cause a load balancer to incorrectly believe the unicorn workers are ready to serve traffic even while the app is being loaded. Once a listener is bound, connect() requests from the load balancer succeed until the listen backlog is filled. This allows requests to pile up for a bit (depending on backlog size) before getting rejected by the kernel. By the time the application is loaded and ready-to-run, requests in the listen backlog are likely stale and not useful to process. Processes inheriting listeners do not suffer this effect, as the old process should still be capable of serving new requests. This change does not improve the situation for the preload_app=false (default) use case. There may not be a solution for preload_app=false users using large applications. Fortunately Ruby 1.9.3+ improves load times of large applications significantly over 1.9.2 so this should be less of a problem in the future. Reported via private email sent on 2012-06-29T22:59:10Z commit 91a3cde091d4ae6ff436681f155b3907daae1c04 Author: Eric Wong Date: Thu Jul 26 23:44:04 2012 +0000 remove Rails-oriented integration tests It's too much overhead to keep Rails-specific tests working, especially when it's hauling in an ancient version of SQLite3. Since Rails 3 has settled down with Rack and unicorn_rails is unlikely to need changing in the future, we can drop these tests.