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

Added caching for information from archive job for logging after the object is potentially deleted.

parent b068174b
......@@ -39,7 +39,10 @@ DiskReadTask::DiskReadTask(DataConsumer & destination,
size_t numberOfBlock,castor::server::AtomicFlag& errorFlag):
m_nextTask(destination),m_archiveJob(archiveJob),
m_numberOfBlock(numberOfBlock),m_errorFlag(errorFlag)
{}
{
m_archiveJobCachedInfo.remotePath = m_archiveJob->remotePathAndStatus.path.getRaw();
m_archiveJobCachedInfo.fileId = m_archiveJob->archiveFile.fileId;
}
//------------------------------------------------------------------------------
// DiskReadTask::execute
......@@ -208,8 +211,8 @@ void DiskReadTask::logWithStat(int level,const std::string& msg,log::LogContext&
m_stats.transferTime?1.0*m_stats.dataVolume/1000/1000/m_stats.transferTime:0)
.add("openRWCloseToTransferTimeRatio",
m_stats.transferTime?(m_stats.openingTime+m_stats.readWriteTime+m_stats.closingTime)/m_stats.transferTime:0.0)
.add("FILEID",m_archiveJob->archiveFile.fileId)
.add("path",m_archiveJob->remotePathAndStatus.path.getRaw());
.add("FILEID",m_archiveJobCachedInfo.fileId)
.add("path",m_archiveJobCachedInfo.remotePath);
lc.log(level,msg);
}
......
......@@ -97,6 +97,16 @@ private:
*/
cta::ArchiveJob *m_archiveJob;
/**
* Information about the archive job we will cache as it is needed
* after the archive job is going to be potentially deleted by the
* writer
*/
struct {
std::string remotePath;
uint64_t fileId;
} m_archiveJobCachedInfo;
/**
* The number of memory block we will need to read the whole file
*/
......
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