Review Board 1.7.22

FLUME-1205. NPE related to checkpointing in File Channel

Review Request #5200 - Created May 22, 2012 and submitted

Arvind Prabhakar
The NPE reported in FLUME-1205 is due to a race condition during the initialization of the File Channel where the checkpoint reference is not yet initialized but the Log is declared open. As a result the background worker runs into the given NPE. 

The fix is to delay the declaration of open to the very last step of replay method by which time all the needed state will be initialized. Doing this required removing precondition checks from Log.writeCheckpoint() and Log.roll() methods, both of which are private and their access paths for normal operations do apply these checks.
Ran all unit tests.
Ship it!
Posted (May 22, 2012, 11:09 p.m.)