• Alex Dadgar's avatar
    Fix two issues during client restore state · 4826d846
    Alex Dadgar authored
    This PR fixes two issues:
    
    1) A close of a nil stopCollection channel when restoring and prestart
    fails. The failure will cause the killCh to be triggered which will
    close collection before it has been initialized.
    
    2) Fixes a deadlock in which the handleWaitCh is never triggered since
    it is not initialized when there is an error in prestart and the killCh
    is triggered.
    
    Both fixes are by maintaining the loop invariant that the two channels
    are valid after there is a handle.
    4826d846