From a87866f83c0185757b2f85aeab17e2a9553b6ae1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Mar 2009 22:46:34 -0700 Subject: Don't bother unlinking UNIX sockets Since we always unlink existing sockets when binding, there's no point in having code to unlink the sockets when we exit. Additionally, the old code path was racy. --- lib/unicorn.rb | 1 - lib/unicorn/socket.rb | 7 ------- 2 files changed, 8 deletions(-) (limited to 'lib') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 2f86de2..eefbfc1 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -106,7 +106,6 @@ module Unicorn @listeners.delete_if do |io| if dead_names.include?(sock_name(io)) @io_purgatory.delete_if { |pio| pio.fileno == io.fileno } - destroy_safely(io) true else false diff --git a/lib/unicorn/socket.rb b/lib/unicorn/socket.rb index 4913261..9519448 100644 --- a/lib/unicorn/socket.rb +++ b/lib/unicorn/socket.rb @@ -62,13 +62,6 @@ module Unicorn end end - def destroy_safely(io) - if io.respond_to?(:path) && File.stat(io.path).ino == io.stat.ino - File.unlink(io.path) rescue nil - end - io.close rescue nil - end - # creates a new server, socket. address may be a HOST:PORT or # an absolute path to a UNIX socket. address can even be a Socket # object in which case it is immediately returned -- cgit v1.2.3-24-ge0c7 From 9ccced22c38c30e776edc5c2513194623b42a7a9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Mar 2009 16:25:45 -0700 Subject: Ensure Tempfiles are unlinked after every request Otherwise we bloat TMPDIR and run the host out of space, oops! --- lib/unicorn/http_request.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 411c56c..ee407ab 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -25,6 +25,7 @@ module Unicorn @parser.reset @params.clear @body.close rescue nil + @body.close! rescue nil @body = nil end -- cgit v1.2.3-24-ge0c7 From 9c338507225446cb5c477a91c5e5da0bfe305949 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Mar 2009 16:31:33 -0700 Subject: unicorn 0.2.3 --- lib/unicorn/const.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb index 8f9e978..ed7f5b1 100644 --- a/lib/unicorn/const.rb +++ b/lib/unicorn/const.rb @@ -68,7 +68,7 @@ module Unicorn REQUEST_URI='REQUEST_URI'.freeze REQUEST_PATH='REQUEST_PATH'.freeze - UNICORN_VERSION="0.2.2".freeze + UNICORN_VERSION="0.2.3".freeze UNICORN_TMP_BASE="unicorn".freeze -- cgit v1.2.3-24-ge0c7