Commit e22a8a32 authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Added catch for NoSuchObject exception to avoid ERROR logs while removing a Repack Request

parent f03d485a
......@@ -441,7 +441,8 @@ void GarbageCollector::OwnedObjectSorter::executeArchiveAlgorithm(std::list<std:
.add("copyNb", arup.copyNb)
.add("fileId", arup.archiveRequest->getArchiveFile().archiveFileID)
.add("exceptionType", debugType);
lc.log(log::ERR,
int logLevel = typeid(e) == typeid(Backend::NoSuchObject) ? log::WARNING : log::ERR;
lc.log(logLevel,
"In GarbageCollector::OwnedObjectSorter::lockFetchAndUpdateArchiveJobs(): "
"failed to requeue gone/not owned archive job. Removed from queue.");
} else {
......
......@@ -50,6 +50,8 @@ void Sorter::executeArchiveAlgorithm(const std::string tapePool, std::string& qu
for(auto &failedAR: failure.failedElements){
try{
std::rethrow_exception(failedAR.failure);
} catch (const cta::objectstore::Backend::NoSuchObject &ex) {
lc.log(log::WARNING,"In Sorter::executeArchiveAlgorithm(), queueing impossible, jobs do not exist in the objectstore.");
} catch(const cta::exception::Exception &e){
uint32_t copyNb = failedAR.element->copyNb;
std::get<1>(succeededJobs[copyNb]->jobToQueue).set_exception(std::current_exception());
......@@ -167,6 +169,8 @@ void Sorter::executeRetrieveAlgorithm(const std::string vid, std::string& queueA
for(auto& failedRR: failure.failedElements){
try{
std::rethrow_exception(failedRR.failure);
} catch (const cta::objectstore::Backend::NoSuchObject &ex) {
lc.log(log::WARNING,"In Sorter::executeRetrieveAlgorithm(), queueing impossible, jobs do not exist in the objectstore.");
} catch (const cta::exception::Exception&){
uint32_t copyNb = failedRR.element->copyNb;
std::get<1>(succeededJobs[copyNb]->jobToQueue).set_exception(std::current_exception());
......
......@@ -18,6 +18,7 @@
#include "scheduler/ArchiveMount.hpp"
#include "common/make_unique.hpp"
#include "objectstore/Backend.hpp"
//------------------------------------------------------------------------------
// constructor
......@@ -218,6 +219,18 @@ void cta::ArchiveMount::reportJobsBatchTransferred(std::queue<std::unique_ptr<ct
.add("schedulerDbTime", schedulerDbTime)
.add("totalTime", catalogueTime + schedulerDbTime + clientReportingTime);
logContext.log(log::INFO, "In ArchiveMount::reportJobsBatchWritten(): recorded a batch of archive jobs in metadata.");
} catch (const cta::objectstore::Backend::NoSuchObject& ex){
cta::log::ScopedParamContainer params(logContext);
params.add("exceptionMessageValue", ex.getMessageValue());
if (job.get()) {
params.add("fileId", job->archiveFile.archiveFileID)
.add("diskInstance", job->archiveFile.diskInstance)
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path)
.add("reportURL", job->reportURL());
}
const std::string msg_error="In ArchiveMount::reportJobsBatchWritten(): job does not exist in the objectstore.";
logContext.log(cta::log::WARNING, msg_error);
} catch(const cta::exception::Exception& e){
cta::log::ScopedParamContainer params(logContext);
params.add("exceptionMessageValue", e.getMessageValue());
......
......@@ -1981,6 +1981,12 @@ void OStoreDB::RepackRetrieveSuccessesReportBatch::report(log::LogContext& lc) {
rr.subrequest->asyncTransformToArchiveRequest(*m_oStoreDb.m_agentReference)
)
});
} catch (const cta::objectstore::Backend::NoSuchObject &ex){
log::ScopedParamContainer params(lc);
params.add("fileId", rr.archiveFile.archiveFileID)
.add("subrequestAddress", rr.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackRetrieveSuccessesReportBatch::report(): failed to asyncTransformToArchiveRequest(), object does not exist in the objectstore.");
} catch (exception::Exception & ex) {
// We failed to archive the file (to create the request, in fact). So all the copyNbs
// can be counted as failed.
......@@ -2036,6 +2042,12 @@ void OStoreDB::RepackRetrieveSuccessesReportBatch::report(log::LogContext& lc) {
atar.subrequestInfo,
sorterArchiveRequest
});
} catch (const cta::objectstore::Backend::NoSuchObject &ex){
log::ScopedParamContainer params(lc);
params.add("fileId", atar.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", atar.subrequestInfo.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackRetrieveSuccessesReportBatch::report(): async transformation failed on wait(). Object does not exist in the objectstore");
} catch (exception::Exception & ex) {
// We failed to archive the file (to create the request, in fact). So all the copyNbs
// can be counted as failed.
......@@ -2087,12 +2099,18 @@ void OStoreDB::RepackRetrieveSuccessesReportBatch::report(log::LogContext& lc) {
try {
asyncDeleterAndReqs.push_back({*fs,
std::unique_ptr<RetrieveRequest::AsyncJobDeleter>(fs->subrequest->asyncDeleteJob())});
} catch (const cta::objectstore::Backend::NoSuchObject &ex) {
log::ScopedParamContainer params(lc);
params.add("fileId", fs->archiveFile.archiveFileID)
.add("subrequestAddress", fs->subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackRetrieveSuccessesReportBatch::report(): failed to asyncDelete() retrieve request. Object does not exist in the objectstore.");
} catch (cta::exception::Exception &ex) {
// Log the failure to delete.
log::ScopedParamContainer params(lc);
params.add("fileId", fs->archiveFile.archiveFileID)
.add("subrequestAddress", fs->subrequest->getAddressIfSet())
.add("excepitonMsg", ex.getMessageValue());
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::ERR, "In OStoreDB::RepackRetrieveSuccessesReportBatch::report(): failed to asyncDelete() retrieve request.");
}
}
......@@ -2105,6 +2123,13 @@ void OStoreDB::RepackRetrieveSuccessesReportBatch::report(log::LogContext& lc) {
params.add("fileId", adar.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", adar.subrequestInfo.subrequest->getAddressIfSet());
lc.log(log::INFO, "In OStoreDB::RepackRetrieveSuccessesReportBatch::report(): deleted retrieve request after failure to transform in archive request.");
} catch (const cta::objectstore::Backend::NoSuchObject & ex) {
// Log the failure to delete.
log::ScopedParamContainer params(lc);
params.add("fileId", adar.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", adar.subrequestInfo.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackRetrieveSuccessesReportBatch::report(): async deletion of retrieve request failed on wait(). Object does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
// Log the failure to delete.
log::ScopedParamContainer params(lc);
......@@ -2194,6 +2219,12 @@ void OStoreDB::RepackRetrieveFailureReportBatch::report(log::LogContext& lc){
retrieveRequestsToUnown.push_back(fs.subrequest->getAddressIfSet());
try{
asyncDeleterAndReqs.push_back({fs,std::unique_ptr<RetrieveRequest::AsyncJobDeleter>(fs.subrequest->asyncDeleteJob())});
} catch (cta::objectstore::Backend::NoSuchObject &ex) {
log::ScopedParamContainer params(lc);
params.add("fileId", fs.archiveFile.archiveFileID)
.add("subrequestAddress", fs.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackRetrieveFailureReportBatch::report(): failed to asyncDelete() retrieve request. Object does not exist in the objectstore.");
} catch (cta::exception::Exception &ex) {
// Log the failure to delete.
log::ScopedParamContainer params(lc);
......@@ -2215,6 +2246,13 @@ void OStoreDB::RepackRetrieveFailureReportBatch::report(log::LogContext& lc){
timingList.addToLog(params);
lc.log(log::INFO, "In OStoreDB::RepackRetrieveFailureReportBatch::report(): deleted retrieve request after multiple failures");
timingList.clear();
} catch (const cta::objectstore::Backend::NoSuchObject & ex) {
// Log the failure to delete.
log::ScopedParamContainer params(lc);
params.add("fileId", adar.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", adar.subrequestInfo.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackRetrieveFailureReportBatch::report(): async deletion of retrieve request failed on wait(). Object does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
// Log the failure to delete.
log::ScopedParamContainer params(lc);
......@@ -3933,6 +3971,13 @@ void OStoreDB::RetrieveMount::flushAsyncSuccessReports(std::list<cta::SchedulerD
}
mountPolicy = osdbJob->m_jobSucceedForRepackReporter->m_MountPolicy;
jobsToRequeueForRepackMap[osdbJob->m_repackInfo.repackRequestAddress].emplace_back(osdbJob);
} catch (cta::objectstore::Backend::NoSuchObject &ex){
log::ScopedParamContainer params(lc);
params.add("fileId", osdbJob->archiveFile.archiveFileID)
.add("requestObject", osdbJob->m_retrieveRequest.getAddressIfSet())
.add("exceptionMessage", ex.getMessageValue());
lc.log(log::WARNING,
"In OStoreDB::RetrieveMount::flushAsyncSuccessReports(): async status update failed, job does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
log::ScopedParamContainer params(lc);
params.add("fileId", osdbJob->archiveFile.archiveFileID)
......@@ -4006,16 +4051,21 @@ void OStoreDB::RetrieveMount::flushAsyncSuccessReports(std::list<cta::SchedulerD
params.add("fileId", requestToJobMap.at(fe.element->retrieveRequest)->archiveFile.archiveFileID)
.add("copyNb", fe.element->copyNb)
.add("requestObject", fe.element->retrieveRequest->getAddressIfSet());
std::string logMessage = "In OStoreDB::RetrieveMount::flushAsyncSuccessReports(): failed to queue request to report for repack."
" Leaving request to be garbage collected.";
int priority = log::ERR;
try {
std::rethrow_exception(fe.failure);
} catch (cta::objectstore::Backend::NoSuchObject &ex) {
priority=log::WARNING;
logMessage = "In OStoreDB::RetrieveMount::flushAsyncSuccessReports(): failed to queue request to report for repack, job does not exist in the objectstore.";
} catch (cta::exception::Exception & ex) {
params.add("exeptionMessage", ex.getMessageValue());
} catch (std::exception & ex) {
params.add("exceptionWhat", ex.what())
.add("exceptionTypeName", typeid(ex).name());
}
lc.log(log::ERR, "In OStoreDB::RetrieveMount::flushAsyncSuccessReports(): failed to queue request to report for repack."
"Leaving request to be garbage collected.");
lc.log(priority, logMessage);
// Add the failed request to the set.
failedElements.insert(fe.element->retrieveRequest->getAddressIfSet());
}
......@@ -4168,6 +4218,11 @@ void OStoreDB::ArchiveMount::setJobBatchTransferred(std::list<std::unique_ptr<ct
.add("jobs", list.second.size())
.add("enqueueTime", t.secs());
lc.log(log::INFO, "In OStoreDB::ArchiveMount::setJobBatchTransferred(): queued a batch of requests for reporting to repack.");
} catch (cta::objectstore::Backend::NoSuchObject &ex) {
log::ScopedParamContainer params(lc);
params.add("tapeVid", list.first)
.add("exceptionMSG", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::ArchiveMount::setJobBatchTransferred(): failed to queue a batch of requests for reporting to repack, jobs do not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
log::ScopedParamContainer params(lc);
params.add("tapeVid", list.first)
......@@ -4632,6 +4687,13 @@ void OStoreDB::RepackArchiveReportBatch::report(log::LogContext& lc){
newStatus)),
sri});
}
} catch(const cta::objectstore::Backend::NoSuchObject &ex) {
// Log the error
log::ScopedParamContainer params(lc);
params.add("fileId", sri.archiveFile.archiveFileID)
.add("subrequestAddress", sri.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackArchiveReportBatch::report(): failed to asyncUpdateJobOwner(), object does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
// Log the error
log::ScopedParamContainer params(lc);
......@@ -4643,6 +4705,13 @@ void OStoreDB::RepackArchiveReportBatch::report(log::LogContext& lc){
} else {
try {
deletersList.push_back({std::unique_ptr<objectstore::ArchiveRequest::AsyncRequestDeleter>(ar.asyncDeleteRequest()), sri});
} catch(const cta::objectstore::Backend::NoSuchObject &ex) {
// Log the error
log::ScopedParamContainer params(lc);
params.add("fileId", sri.archiveFile.archiveFileID)
.add("subrequestAddress", sri.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackArchiveReportBatch::report(): failed to asyncDelete(), object does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
// Log the error
log::ScopedParamContainer params(lc);
......@@ -4680,6 +4749,13 @@ void OStoreDB::RepackArchiveReportBatch::report(log::LogContext& lc){
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::ERR, "In OStoreDB::RepackArchiveReportBatch::report(): async deletion of disk file failed.");
}
} catch(const cta::objectstore::Backend::NoSuchObject &ex){
// Log the error
log::ScopedParamContainer params(lc);
params.add("fileId", d.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", d.subrequestInfo.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackArchiveReportBatch::report(): async deletion failed. Object does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
// Log the error
log::ScopedParamContainer params(lc);
......@@ -4707,28 +4783,32 @@ void OStoreDB::RepackArchiveReportBatch::report(log::LogContext& lc){
lc.log(log::ERR, "In OStoreDB::RepackArchiveReportBatch::report(): async file not deleted.");
}
}
if(repackRequestStatus == objectstore::serializers::RepackRequestStatus::RRS_Complete){
//Repack Request is complete, delete the directory in the buffer
cta::disk::DirectoryFactory directoryFactory;
std::string directoryPath = cta::utils::getEnclosingPath(bufferURL);
std::unique_ptr<cta::disk::Directory> directory;
{
cta::ScopedExclusiveLock sel(m_repackRequest);
m_repackRequest.fetch();
m_repackRequest.setIsComplete(true);
m_repackRequest.commit();
}
try{
directory.reset(directoryFactory.createDirectory(directoryPath));
directory->rmdir();
log::ScopedParamContainer params(lc);
params.add("repackRequestAddress", m_repackRequest.getAddressIfSet());
lc.log(log::INFO, "In OStoreDB::RepackArchiveReportBatch::report(): deleted the "+directoryPath+" directory");
} catch (const cta::exception::Exception &ex){
log::ScopedParamContainer params(lc);
params.add("repackRequestAddress", m_repackRequest.getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::ERR, "In OStoreDB::RepackArchiveReportBatch::report(): failed to remove the "+directoryPath+" directory");
if(repackRequestStatus == objectstore::serializers::RepackRequestStatus::RRS_Complete || repackRequestStatus == objectstore::serializers::RepackRequestStatus::RRS_Failed)
{
//Repack request is Complete or Failed, set it as complete
//to tell the cta-admin repack rm command not to try to delete all the subrequests again
cta::ScopedExclusiveLock sel(m_repackRequest);
m_repackRequest.fetch();
m_repackRequest.setIsComplete(true);
m_repackRequest.commit();
if(repackRequestStatus == objectstore::serializers::RepackRequestStatus::RRS_Complete){
//Repack Request is complete, delete the directory in the buffer
cta::disk::DirectoryFactory directoryFactory;
std::string directoryPath = cta::utils::getEnclosingPath(bufferURL);
std::unique_ptr<cta::disk::Directory> directory;
try{
directory.reset(directoryFactory.createDirectory(directoryPath));
directory->rmdir();
log::ScopedParamContainer params(lc);
params.add("repackRequestAddress", m_repackRequest.getAddressIfSet());
lc.log(log::INFO, "In OStoreDB::RepackArchiveReportBatch::report(): deleted the "+directoryPath+" directory");
} catch (const cta::exception::Exception &ex){
log::ScopedParamContainer params(lc);
params.add("repackRequestAddress", m_repackRequest.getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::ERR, "In OStoreDB::RepackArchiveReportBatch::report(): failed to remove the "+directoryPath+" directory");
}
}
}
for (auto & jou: jobOwnerUpdatersList) {
......@@ -4738,6 +4818,13 @@ void OStoreDB::RepackArchiveReportBatch::report(log::LogContext& lc){
params.add("fileId", jou.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", jou.subrequestInfo.subrequest->getAddressIfSet());
lc.log(log::INFO, "In OStoreDB::RepackArchiveReportBatch::report(): async updated job.");
} catch(const cta::objectstore::Backend::NoSuchObject &ex){
// Log the error
log::ScopedParamContainer params(lc);
params.add("fileId", jou.subrequestInfo.archiveFile.archiveFileID)
.add("subrequestAddress", jou.subrequestInfo.subrequest->getAddressIfSet())
.add("exceptionMsg", ex.getMessageValue());
lc.log(log::WARNING, "In OStoreDB::RepackArchiveReportBatch::report(): async job update failed. Object does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
// Log the error
log::ScopedParamContainer params(lc);
......
......@@ -40,14 +40,19 @@ void RepackRequestManager::runOnePass(log::LogContext& lc) {
if(repackRequest != nullptr){
//We have a RepackRequest that has the status ToExpand, expand it
try{
m_scheduler.expandRepackRequest(repackRequest,timingList,t,lc);
} catch (const ExpandRepackRequestException& ex){
lc.log(log::ERR,ex.what());
repackRequest->fail();
} catch (const cta::exception::Exception &e){
lc.log(log::ERR,e.what());
repackRequest->fail();
throw(e);
try{
m_scheduler.expandRepackRequest(repackRequest,timingList,t,lc);
} catch (const ExpandRepackRequestException& ex){
lc.log(log::ERR,ex.what());
repackRequest->fail();
} catch (const cta::exception::Exception &e){
lc.log(log::ERR,e.what());
repackRequest->fail();
throw(e);
}
} catch (const cta::objectstore::Backend::NoSuchObject &ex){
//In case the repack request is deleted during expansion, avoid a segmentation fault of the tapeserver
lc.log(log::WARNING,"In RepackRequestManager::runOnePass(), RepackRequest object does not exist in the objectstore");
}
}
}
......
......@@ -19,6 +19,7 @@
#include "scheduler/RetrieveMount.hpp"
#include "common/Timer.hpp"
#include "common/log/TimingList.hpp"
#include "objectstore/Backend.hpp"
#include "disk/DiskSystem.hpp"
//------------------------------------------------------------------------------
......@@ -199,8 +200,19 @@ void cta::RetrieveMount::flushAsyncSuccessReports(std::queue<std::unique_ptr<cta
.add("bytes", bytes);
tl.addToLog(params);
//TODO : if repack, add log to say that the jobs were marked as RJS_Succeeded
logContext.log(cta::log::DEBUG,"In RetrieveMout::waitAndFinishSettingJobsBatchRetrieved(): deleted complete retrieve jobs.");
logContext.log(cta::log::DEBUG,"In cta::RetrieveMount::flushAsyncSuccessReports(): deleted complete retrieve jobs.");
}
} catch(const cta::objectstore::Backend::NoSuchObject &ex){
cta::log::ScopedParamContainer params(logContext);
params.add("exceptionMessageValue", ex.getMessageValue());
if (job.get()) {
params.add("fileId", job->archiveFile.archiveFileID)
.add("diskInstance", job->archiveFile.diskInstance)
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path);
}
const std::string msg_error="In cta::RetrieveMount::flushAsyncSuccessReports(): unable to access jobs, they do not exist in the objectstore.";
logContext.log(cta::log::WARNING, msg_error);
} catch(const cta::exception::Exception& e){
cta::log::ScopedParamContainer params(logContext);
params.add("exceptionMessageValue", e.getMessageValue());
......@@ -210,7 +222,7 @@ void cta::RetrieveMount::flushAsyncSuccessReports(std::queue<std::unique_ptr<cta
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path);
}
const std::string msg_error="In RetrieveMount::waitAndFinishSettingJobsBatchRetrieved(): got an exception";
const std::string msg_error="In cta::RetrieveMount::flushAsyncSuccessReports(): got an exception";
logContext.log(cta::log::ERR, msg_error);
logContext.logBacktrace(cta::log::ERR, e.backtrace());
// Failing here does not really affect the session so we can carry on. Reported jobs are reported, non-reported ones
......@@ -224,7 +236,7 @@ void cta::RetrieveMount::flushAsyncSuccessReports(std::queue<std::unique_ptr<cta
.add("diskFileId", job->archiveFile.diskFileId)
.add("lastKnownDiskPath", job->archiveFile.diskFileInfo.path);
}
const std::string msg_error="In RetrieveMount::reportJobsBatchWritten(): got an standard exception";
const std::string msg_error="In cta::RetrieveMount::flushAsyncSuccessReports(): got an standard exception";
logContext.log(cta::log::ERR, msg_error);
// Failing here does not really affect the session so we can carry on. Reported jobs are reported, non-reported ones
// will be retried.
......
......@@ -26,6 +26,7 @@
#include "castor/tape/tapeserver/drive/DriveInterface.hpp"
#include "catalogue/TapeFileWritten.hpp"
#include "common/utils/utils.hpp"
#include "objectstore/Backend.hpp"
#include <memory>
#include <numeric>
......@@ -197,6 +198,11 @@ void MigrationReportPacker::ReportSkipped::execute(MigrationReportPacker& report
}
try {
m_skippedArchiveJob->transferFailed(m_failureLog, reportPacker.m_lc);
} catch (cta::objectstore::Backend::NoSuchObject & ex){
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
.add("fileId", m_skippedArchiveJob->archiveFile.archiveFileID);
reportPacker.m_lc.log(cta::log::WARNING,"In MigrationReportPacker::ReportSkipped::execute(): call to m_failedArchiveJob->failed(), job does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
......@@ -346,7 +352,13 @@ void MigrationReportPacker::ReportError::execute(MigrationReportPacker& reportPa
}
try {
m_failedArchiveJob->transferFailed(m_failureLog, reportPacker.m_lc);
} catch (cta::exception::Exception & ex) {
} catch (cta::objectstore::Backend::NoSuchObject & ex){
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
.add("fileId", m_failedArchiveJob->archiveFile.archiveFileID);
reportPacker.m_lc.log(cta::log::WARNING,"In MigrationReportPacker::ReportError::execute(): call to m_failedArchiveJob->failed(), job does not exist in the objectstore.");
}
catch (cta::exception::Exception & ex) {
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
.add("fileId", m_failedArchiveJob->archiveFile.archiveFileID);
......
......@@ -25,6 +25,7 @@
#include "castor/tape/tapeserver/daemon/TaskWatchDog.hpp"
#include "common/log/Logger.hpp"
#include "common/utils/utils.hpp"
#include "objectstore/Backend.hpp"
#include <signal.h>
#include <iostream>
......@@ -115,8 +116,15 @@ void RecallReportPacker::reportTestGoingToEnd(){
//ReportSuccessful::execute
//------------------------------------------------------------------------------
void RecallReportPacker::ReportSuccessful::execute(RecallReportPacker& parent){
m_successfulRetrieveJob->asyncSetSuccessful();
parent.m_successfulRetrieveJobs.push(std::move(m_successfulRetrieveJob));
try{
m_successfulRetrieveJob->asyncSetSuccessful();
parent.m_successfulRetrieveJobs.push(std::move(m_successfulRetrieveJob));
} catch (const cta::objectstore::Backend::NoSuchObject &ex){
cta::log::ScopedParamContainer params(parent.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
.add("fileId", m_successfulRetrieveJob->archiveFile.archiveFileID);
parent.m_lc.log(cta::log::WARNING,"In RecallReportPacker::ReportSuccessful::execute(): call to m_successfulRetrieveJob->asyncSetSuccessful() failed, job does not exist in the objectstore.");
}
}
//------------------------------------------------------------------------------
......@@ -212,6 +220,11 @@ void RecallReportPacker::ReportError::execute(RecallReportPacker& reportPacker){
}
try {
m_failedRetrieveJob->transferFailed(m_failureLog, reportPacker.m_lc);
} catch (const cta::objectstore::Backend::NoSuchObject &ex){
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
.add("fileId", m_failedRetrieveJob->archiveFile.archiveFileID);
reportPacker.m_lc.log(cta::log::WARNING,"In RecallReportPacker::ReportError::execute(): call to m_failedRetrieveJob->failed() , job does not exist in the objectstore.");
} catch (cta::exception::Exception & ex) {
cta::log::ScopedParamContainer params(reportPacker.m_lc);
params.add("ExceptionMSG", ex.getMessageValue())
......
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