Rack::BodyProxy should execute block even on failures. #313

Merged
merged 1 commit into from Jan 13, 2012

Conversation

Projects
None yet
2 participants
@josevalim
Contributor

josevalim commented Jan 13, 2012

In general, Rack frameworks are moving logic to close hooks in order
to support async behavior increasing the chance an exception will
happen on close. Most servers will actually die if there is an exception
on close, but such exceptions can also happen in the test environment.
In such cases, we can accidentally leave a mutex locked, a database
connection not collected and so forth, therefore, we need to ensure
the block is called regardless closing the body failed.

Rack::BodyProxy should execute block even on failures.
In general, Rack frameworks are moving logic to close hooks in order
to support async behavior increasing the chance an exception will
happen on close. Most servers will actually die if there is an exception
on close, but such exceptions can also happen in the test environment.
In such cases, we can accidentally leave a mutex locked, a database
connection not collected and so forth, therefore, we need to ensure
the block is called regardless closing the body failed.

tenderlove added a commit that referenced this pull request Jan 13, 2012

Merge pull request #313 from josevalim/ensure_proxy
Rack::BodyProxy should execute block even on failures.

@tenderlove tenderlove merged commit 6cb96fe into rack:master Jan 13, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment