celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
595 stars 87 forks source link

Infinite wait for `defer { IO.copy_stream }` on files larger than X. #103

Closed digitalextremist closed 11 years ago

digitalextremist commented 11 years ago

One of the #90 twins.

If one repeatedly refreshes an asset such as /favicon.ico this behavior will not happen. Apparently it is of a certain size where its contents transfer immediately with no interruption. But if there is an asset of a certain amount of size X which is an unknown number right now, it will infinitely wait to fully copy from source to destination.

The main cause I could foresee would be the defer { } operation never having the opportunity to complete. How can this be diagnosed and solved?

digitalextremist commented 11 years ago

This seems to be only occurring on N > 1 requests of one pipeline.

tarcieri commented 11 years ago

I think the solution here is to get rid of the defer and run all IO through the reactor

digitalextremist commented 11 years ago

Is there code referencing this style which I can work from to see if I can refactor my PR's, or would you rather do it?

tarcieri commented 11 years ago

Nope. Actually I think I'll just merge your PRs for now and loop back on this later...

digitalextremist commented 11 years ago

Looks like jRuby 1.7.5 might impact this for the better, but it looks like the issue is closed for now either way.