Commit bfa7fd76 authored by Eric Cano's avatar Eric Cano
Browse files

Added support for zero-length file in tape write tasks.

We now leave a placeholder on the tape and carry on in this case. The errors will eventually clear the
archive request.
parent 062e0288
......@@ -135,6 +135,21 @@ namespace daemon {
// If, after the FIFO is finished, we are still in the first block, we are in the presence of a 0-length file.
// This also requires a placeholder.
if (firstBlock) {
currentErrorToCount = "Error_tapeWriteData";
const char blank[]="This file intentionally left blank: zero-length file cannot be recorded to tape.";
output->write(blank, sizeof(blank));
m_taskStats.readWriteTime += timer.secs(cta::utils::Timer::resetCounter);
currentErrorToCount = "Error_tapeWriteTrailer";
currentErrorToCount = "";
// Possibly failing writes are finished. We can continue this in catch for skip. outside of the loop.
throw Skip("In TapeWriteTask::execute(): inserted a placeholder for zero length file.");
//finish the writing of the file on tape
//put the trailer
currentErrorToCount = "Error_tapeWriteTrailer";
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