> but I wonder why not return OK rather than LedgerClosedException.
I just want to make the return code clearly to tell what happened.
> I'm not sure why you have removed the call to close in BookieRecoveryTest.
since the ledger handle is already closed. we don't need to close it again.
> In fact, I thought this was the case with TestFencing, so I'm wondering why it is correct to replace the exception like that.
since closeLedgers is closed before recovering, so the ledger handles are already closed. closing them again is supposed to return LedgerClosedException. we don't get metadata version exception anymore. It is based on the new behavior to change that exception.
> One other suggestion is to add comments describing why we need to check if the ledger is closed in those two places.
I could do it if the above comments make sense for you.