Commit 810d1ff9 authored by Eric Cano's avatar Eric Cano
Browse files

Removed the asynchronous MigrationTaskInjector::deleteAllTasks as we cleanly

wait for the end of execution pipeline draining in all cases in MigrationTaskInjector::WorkerThread::run.
The asynchronous deleteAllTasks deleted the end-of-session signaling to the task injector, which led this
end of MigrationTaskInjector::WorkerThread::run into infinte waiting for this dropped end of session signal.
parent b2b5bb58
...@@ -171,16 +171,8 @@ namespace daemon { ...@@ -171,16 +171,8 @@ namespace daemon {
m_diskReader.finish(); m_diskReader.finish();
m_memManager.finish(); m_memManager.finish();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//deleteAllTasks
//------------------------------------------------------------------------------
void MigrationTaskInjector::deleteAllTasks(){
//discard all the tasks !!
while(m_queue.size()>0){
m_queue.pop();
}
}
//------------------------------------------------------------------------------
//WorkerThread::run //WorkerThread::run
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void MigrationTaskInjector::WorkerThread::run(){ void MigrationTaskInjector::WorkerThread::run(){
...@@ -212,11 +204,10 @@ namespace daemon { ...@@ -212,11 +204,10 @@ namespace daemon {
}//end of try }//end of try
catch(const castor::tape::tapeserver::daemon::ErrorFlag&){ catch(const castor::tape::tapeserver::daemon::ErrorFlag&){
//we end up there because a task screw up somewhere //we end up there because a task screw up somewhere
m_parent.m_lc.log(LOG_ERR,"In MigrationTaskInjector::WorkerThread::run(): a task screw up, " m_parent.m_lc.log(LOG_ERR,"In MigrationTaskInjector::WorkerThread::run(): a task failed, "
"finishing and discarding all tasks "); "indicating finish of run");
m_parent.signalEndDataMovement(); m_parent.signalEndDataMovement();
m_parent.deleteAllTasks();
} }
catch(const castor::exception::Exception& ex){ catch(const castor::exception::Exception& ex){
//we end up there because we could not talk to the client //we end up there because we could not talk to the client
...@@ -226,10 +217,9 @@ namespace daemon { ...@@ -226,10 +217,9 @@ namespace daemon {
.add("exception message",ex.getMessageValue()); .add("exception message",ex.getMessageValue());
m_parent.m_lc.logBacktrace(LOG_ERR,ex.backtrace()); m_parent.m_lc.logBacktrace(LOG_ERR,ex.backtrace());
m_parent.m_lc.log(LOG_ERR,"In MigrationTaskInjector::WorkerThread::run(): " m_parent.m_lc.log(LOG_ERR,"In MigrationTaskInjector::WorkerThread::run(): "
"could not retrieve a list of file to migrate. End of session"); "could not retrieve a list of file to migrate, indicating finish of run");
m_parent.signalEndDataMovement(); m_parent.signalEndDataMovement();
m_parent.deleteAllTasks();
} }
//------------- //-------------
m_parent.m_lc.log(LOG_INFO, "Finishing MigrationTaskInjector thread"); m_parent.m_lc.log(LOG_INFO, "Finishing MigrationTaskInjector thread");
......
...@@ -121,10 +121,6 @@ private: ...@@ -121,10 +121,6 @@ private:
*/ */
void signalEndDataMovement(); void signalEndDataMovement();
/**
* It will delete all remaining tasks
*/
void deleteAllTasks();
/** /**
* A request of files to migrate. We request EITHER * A request of files to migrate. We request EITHER
* - a maximum of nbMaxFiles files * - a maximum of nbMaxFiles files
......
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