optimized send_file does not release db connections #123

Closed
kares opened this Issue Oct 9, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@kares
Member

kares commented Oct 9, 2012

originally reported as trinidad/trinidad#90 by @johnae

the work-around for the send_file encoding issue #107 introduced a regression in closing Rack's body 7b87c78
we shall keep and use the "optimized" file streaming (by unwrapping the body parts) but need to make sure the original body gets closed as well otherwise e.g. on Trinidad it was never releasing database connections and the server ended up hanging waiting for connections once pool size requests hit streamed a file.

@kares kares referenced this issue in trinidad/trinidad Oct 9, 2012

Closed

send_file doesn't really work with trinidad #90

kares added a commit that referenced this issue Oct 9, 2012

make sure original rack body gets always closed
the optimized send_file (work-around) added in 7b87c78 had a side effect of not closing the Rails body (ActionDispatch::Response that wraps the file to be sent) which might lead to side-effects such as not releasing database connections (reported as #123)

@kares kares closed this Nov 16, 2012

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