Skip to content
Snippets Groups Projects
Commit 2551f51f authored by Cristina Moraru's avatar Cristina Moraru
Browse files

Fix promise usage

parent 188f773f
Branches
Tags
No related merge requests found
...@@ -62,11 +62,6 @@ RecallTaskInjector::~RecallTaskInjector(){ ...@@ -62,11 +62,6 @@ RecallTaskInjector::~RecallTaskInjector(){
void RecallTaskInjector::finish(){ void RecallTaskInjector::finish(){
cta::threading::MutexLocker ml(m_producerProtection); cta::threading::MutexLocker ml(m_producerProtection);
m_queue.push(Request()); m_queue.push(Request());
/* Since this is the ending request, the RecallTaskInjector does not need
* to wait to have access to the drive
*/
if (m_useRAO)
setPromise();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//requestInjection //requestInjection
......
...@@ -156,12 +156,10 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::popAndRequestMoreJobs(){ ...@@ -156,12 +156,10 @@ castor::tape::tapeserver::daemon::TapeReadSingleThread::popAndRequestMoreJobs(){
vrp = m_tasks.popGetSize(); vrp = m_tasks.popGetSize();
// If we just passed (down) the half full limit, ask for more // If we just passed (down) the half full limit, ask for more
// (the remaining value is after pop) // (the remaining value is after pop)
isLastTask = false;
if(0 == vrp.remaining) { if(0 == vrp.remaining) {
// This is a last call: if the task injector comes up empty on this // This is a last call: if the task injector comes up empty on this
// one, he'll call it the end. // one, he'll call it the end.
m_taskInjector->requestInjection(true); m_taskInjector->requestInjection(true);
isLastTask = true;
} else if (vrp.remaining + 1 == m_maxFilesRequest/2) { } else if (vrp.remaining + 1 == m_maxFilesRequest/2) {
// This is not a last call // This is not a last call
m_taskInjector->requestInjection(false); m_taskInjector->requestInjection(false);
...@@ -322,11 +320,6 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() { ...@@ -322,11 +320,6 @@ void castor::tape::tapeserver::daemon::TapeReadSingleThread::run() {
// This can lead the the session being marked as corrupt, so we test // This can lead the the session being marked as corrupt, so we test
// it in the while loop // it in the while loop
task->execute(*rs, m_logContext, m_watchdog,m_stats,timer); task->execute(*rs, m_logContext, m_watchdog,m_stats,timer);
if (m_useRAO && isLastTask) {
// After the execution of all recalls, the TapeReadSingleThread
// passes the access to the drive to the RecallTaskInjector
m_taskInjector->setPromise();
}
// Transmit the statistics to the watchdog thread // Transmit the statistics to the watchdog thread
m_watchdog.updateStatsWithoutDeliveryTime(m_stats); m_watchdog.updateStatsWithoutDeliveryTime(m_stats);
// The session could have been corrupted (failed positioning) // The session could have been corrupted (failed positioning)
......
...@@ -152,7 +152,6 @@ private: ...@@ -152,7 +152,6 @@ private:
* Access Order * Access Order
*/ */
bool m_useRAO; bool m_useRAO;
bool isLastTask;
/// Helper virtual function to access the watchdog from parent class /// Helper virtual function to access the watchdog from parent class
virtual void countTapeLogError(const std::string & error) { virtual void countTapeLogError(const std::string & error) {
m_watchdog.addToErrorCount(error); m_watchdog.addToErrorCount(error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment