Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
FileBufferedChannel race condition #1326
This was reported by Daniel Shannon. See the attached crash logs:
According to Daniel, Passenger seems to crash whenever he tries to access one of the applications, but only if he accesses from iPhone, and only when the server is serving a pair of video files. This might be some kind of race condition caused by network latency.
I've been able to reproduce the issue by serving two large Rack responses at the same time to clients that don't read the response body. Here's what the server looks like:
I then run two clients:
My crash log is here: https://gist.github.com/FooBarWidget/ca9958d607e2fbe0f7bb
This has been identified as a race condition with libeio. Consider this code:
eio_write() passes the I/O request to a thread before returning. This thread might finish (and call the callback) before the
We need to find a way to start an I/O request without dispatching it to a thread yet.