diff --git a/scheduler/ArchiveJob.cpp b/scheduler/ArchiveJob.cpp index 3121b446e36b5017e6a1e717f84e32a741c08487..c196ea41cb476c880fe8cd669f4bc23d9695588a 100644 --- a/scheduler/ArchiveJob.cpp +++ b/scheduler/ArchiveJob.cpp @@ -92,12 +92,4 @@ void cta::ArchiveJob::complete() { //------------------------------------------------------------------------------ void cta::ArchiveJob::failed(const cta::exception::Exception &ex) { m_dbJob->fail(); - // TODO: callback on the client to signal the failure -} - -//------------------------------------------------------------------------------ -// retry -//------------------------------------------------------------------------------ -void cta::ArchiveJob::retry() { - throw std::runtime_error("cta::ArchiveJob::retry(): not implemented"); } diff --git a/scheduler/ArchiveJob.hpp b/scheduler/ArchiveJob.hpp index 988b0522166fef6c00ab998fe83a15328a159102..24886af4b4f3cd61ffee3aface19d7cb96f976f4 100644 --- a/scheduler/ArchiveJob.hpp +++ b/scheduler/ArchiveJob.hpp @@ -85,12 +85,6 @@ public: * */ virtual void failed(const cta::exception::Exception &ex); - - /** - * Indicates that the job should be tried again (typically reaching the end - * of the tape). - */ - virtual void retry(); private: std::unique_ptr<cta::SchedulerDatabase::ArchiveJob> m_dbJob; diff --git a/scheduler/RetrieveJob.cpp b/scheduler/RetrieveJob.cpp index dad31c58b644a56e7a930676d275dde53e384b62..15abfb2a5bd89069aef02bc6d000a9c1669272a4 100644 --- a/scheduler/RetrieveJob.cpp +++ b/scheduler/RetrieveJob.cpp @@ -50,14 +50,7 @@ void cta::RetrieveJob::complete() { // failed //------------------------------------------------------------------------------ void cta::RetrieveJob::failed() { - throw std::runtime_error("cta::RetrieveJob::failed(): not implemented"); -} - -//------------------------------------------------------------------------------ -// retry -//------------------------------------------------------------------------------ -void cta::RetrieveJob::retry() { - throw std::runtime_error("cta::RetrieveJob::retry(): not implemented"); + m_dbJob->fail(); } //------------------------------------------------------------------------------ diff --git a/scheduler/RetrieveJob.hpp b/scheduler/RetrieveJob.hpp index 40ea4dfc8633f803b8f995beb44c1070ef62de7a..ef7e433b89549a2014e948c375815bb8dccd24f3 100644 --- a/scheduler/RetrieveJob.hpp +++ b/scheduler/RetrieveJob.hpp @@ -83,16 +83,11 @@ public: /** * Indicates that the job failed. Like for complete(), reason for failure - * should already be recorded in the object beforehand. + * should already be recorded in the object beforehand. Retry policy will + * be applied by the scheduler. */ virtual void failed(); - /** - * Indicates that the job should be tried again (typically reaching the end - * of the tape). - */ - void retry(); - /** * Helper function returning a reference to the currently selected tape file. */ diff --git a/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp b/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp index 90dc556131b5ad040431dfa3c1021b632e1bf1ba..4c8925e327fe33e453c4b39b834a91b1f1752ba0 100644 --- a/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp +++ b/tapeserver/castor/tape/tapeserver/file/CryptoPPTest.cpp @@ -184,7 +184,14 @@ namespace unitTests { int tmpFileFd = mkstemp(path); cta::exception::Errnum::throwOnMinusOne(tmpFileFd, "Error creating a temporary file"); m_path = path; - cta::exception::Errnum::throwOnMinusOne(write(tmpFileFd, content.c_str(), content.size())); + try { + cta::exception::Errnum::throwOnMinusOne(write(tmpFileFd, content.c_str(), content.size())); + } catch (...) { + close (tmpFileFd); + ::unlink(m_path.c_str()); + throw; + } + close (tmpFileFd); } ~TempFileForXrootKey() { ::unlink(m_path.c_str());