Improved request body enumerator to use Concurrent.unicast push instead of buffering all the request bytes in memory#169
Conversation
…ad of buffering all the request bytes in memory. This should avoid OOM error when receiving large request body such as file uploads.
|
Integration tests are OK. @takezoe used to have hangs and/or deadlocks here on Tomcat 6 (servlet 2.5). I made this change for him months ago. Before, inputstream was "streamed" thanks to |
Improved request body enumerator to use Concurrent.unicast push instead of buffering all the request bytes in memory
|
Thank you for this contribution. |
|
No problem, but i would wait before pushing it in production. I was doing major investigation about the hanging test case reported by @takezoe but I couldn't reproduce it, instead I found another bug with Concurrent.push implementation. The request hangs when a POST/PUT action throws an exception that is not handled, because the callback in RequestHandler to redeem the result/error from eventuallyResult is never called. The problem does not seems related to a particular container or servlet api (tested with jetty, tomcat, servlet25 and servlet30). I did not found the reason yet, but it could be that the iteratee execution context is not the same of the action handling code. In Play 2.2.0-M1 is possible to pass an execution context to the iteratees, so maybe I could give it a try and let you know any progress. |
|
Ok, I reverted it. |
|
In Play 2.1, this method implementation has been changed fundamentally. So it might work correctly. Anyway, this pull request does not depend on |
This should allow to stream bytes to the body parser iterator as they arrive avoiding OOM error when receiving large request body such as file uploads.