Decide where `m_reportPacker.setTapeDone()` should be called
RecallReportPacker::setTapeDone()
sets m_tapeThreadComplete = true
telling that there is nothing to read from the tape and tape read thread can finish. When both tape and disk threads are finished, the drive status is set to UP. If we fail to call setTapeDone()
in a right place, we may spoil the drive status logic.
At the moment it is called in two places. In TapeReadSingleThread
it is called after the ~TapeCleaning()
is executed. In case of exception, setTapeDone()
is missed, execution goes to catch
that doesn't handle the drive state.
Then the second place is DataTransferSession
in executeRead()
right after readSingleThread
is finished.
We should leave one usage of setTapeDone()
in the right place and make sure the drive status is updated based on m_tapeThreadComplete
. Perhaps, we should setTapeDone()
when unmounting the tape in ~TapeCleaning()
- to be verified.