Commit 5d2363de authored by David COME's avatar David COME
Browse files

Added a few comments in tasks for migration and recall

parent 5dd9e404
......@@ -90,7 +90,7 @@ void DiskReadTask::execute(log::LogContext& lc) {
//we either read at full capacity (ie size=capacity) or if there different,
//it should be the end => migratingFileSize should be 0. If it not, error
if(mb->m_payload.size() != mb->m_payload.totalCapacity() && migratingFileSize>0){
mb->m_failed=true;
mb->markAsFailed();
throw castor::tape::Exception("Error while reading a file. Did not read at full capacity but the file is not fully read");
}
} //end of while(migratingFileSize>0)
......@@ -127,7 +127,8 @@ void DiskReadTask::circulateAllBlocks(size_t fromBlockId){
size_t blockId = fromBlockId;
while(blockId<m_numberOfBlock) {
MemBlock * mb = m_nextTask.getFreeBlock();
mb->m_failed=true;
mb->m_fileid = m_migratedFile->fileid();
mb->markAsFailed();
m_nextTask.pushDataBlock(mb);
++blockId;
} //end of while
......
......@@ -77,9 +77,15 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,log::LogContext& lc) {
} //end of try
catch(const castor::exception::Exception& e){
/*
*We might end up there with some blocks into m_fifo
* We need to empty it
*We might end up there because ;
* -- WriteFile failed
* -- A desynchronization between tape read and disk write
* -- An error in tape read
* -- An error while writing the file
*/
//there might still be some blocks into m_fifo
// We need to empty it
releaseAllBlock();
reporter.reportFailedJob(*m_recallingFile,e.getMessageValue(),e.code());
......
......@@ -107,7 +107,9 @@ public:
// Pass the block to the disk write task
m_fifo.pushDataBlock(mb);
} //end of while(stillReading)
// we have to signal the end of the tape read to the disk write task.
m_fifo.pushDataBlock(NULL);
lc.log(LOG_DEBUG, "File read completed");
} //end of try
catch (castor::exception::Exception & ex) {
//we end up there because :
......@@ -135,12 +137,7 @@ public:
else{
reportErrorToDiskTask(mb);
}
return;
}
// In all cases, we have to signal the end of the tape read to the disk write
// task.
m_fifo.pushDataBlock(NULL);
lc.log(LOG_DEBUG, "File read completed");
} //end of catch
}
/**
* Get a valid block and ask to to do the report to the disk write task
......
......@@ -149,7 +149,7 @@ private:
return writeSession;
}
/**
* Execute flush on tape
* Execute flush on tape, do some log and report the flush to the client
* @param message the message the log will register
* @param bytes the number of bytes that have been written since the last flush
* (for logging)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment