1) the close won't occur if the process is killed with SIGKILL so we need to flush explicitly.
In reality, all takes past that event is really not valid
Are we assuming that the disk will be written to disk sequentially? I don't believe that will always be the case. For example without any fsyncs the last half of a file could be written to disk before the first half. Thus it's possible the first half of the file is corrupt but no the second half. How do we handle this case?
Additionally it's possible that the corruption occurs inside an event. That is the event header is correct and the next event header is correct, but the inside of the event is all null's. In this case we will be sending invalid data downstream.
we can check for this by simply checking the length of the file before doing a take
The file is pre-allocated so I don't follow how this will work?