oob_gc: reimplement to fix breakage and add tests
commitfe0dd93cd9cb97b46f6cfb4b1e370e38717a93f0
authorEric Wong <normalperson@yhbt.net>
Fri, 29 Apr 2011 22:48:35 +0000 (29 15:48 -0700)
committerEric Wong <normalperson@yhbt.net>
Sat, 30 Apr 2011 01:45:55 +0000 (30 01:45 +0000)
tree5e5c45c385ade1bad0e0c6ec6e5eedd379181275
parentd385bc4f3ed7b783b7414f5d34299bd2bf242fe6
oob_gc: reimplement to fix breakage and add tests

This was broken since v3.3.1[1] and v1.1.6[2] since nginx relies on
a closed socket (and not Content-Length/Transfer-Encoding) to
detect a response completion.  We have to close the client
socket before invoking GC to ensure the client sees the response
in a timely manner.

[1] - commit b72a86f66c722d56a6d77ed1d2779ace6ad103ed
[2] - commit b7a0074284d33352bb9e732c660b29162f34bf0e

(cherry picked from commit faeb3223636c39ea8df4017dc9a9d39ac649b26d)

Conflicts:

examples/big_app_gc.rb
lib/unicorn/oob_gc.rb
examples/big_app_gc.rb
lib/unicorn/oob_gc.rb
t/oob_gc.ru [new file with mode: 0644]
t/oob_gc_path.ru [new file with mode: 0644]
t/t9001-oob_gc.sh [new file with mode: 0755]
t/t9002-oob_gc-path.sh [new file with mode: 0644]