Added: #1440 Abort now possible while plugin is working

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent a28341d04c
commit 23a4326229

@ -290,6 +290,12 @@ public:
finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage); finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage);
break; break;
} }
if (m_AbortRequested)
{
nlinfo("Aborted slave task after getting removed files");
finalizeAbort();
break;
}
// Build the lists of files added changed removed // Build the lists of files added changed removed
buildListsOfFiles(); buildListsOfFiles();
@ -307,8 +313,16 @@ public:
{ {
m_SlaveTaskState = SOMEWHERE_INBETWEEN; m_SlaveTaskState = SOMEWHERE_INBETWEEN;
CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_PLUGIN_WORKING); CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_PLUGIN_WORKING);
if (m_AbortRequested)
{
nlinfo("Aborted slave task while plugin was working");
finalizeAbort();
}
else
{
finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage); finishedTask(m_ActiveProcess->m_SubTaskResult, m_ActiveProcess->m_SubTaskErrorMessage);
} }
}
break; break;
default: default:
finishedTask(FINISH_ERROR, "Task got lost somewhere inbetween the code of the slave service. This is a programming error. Implementation may be incomplete."); finishedTask(FINISH_ERROR, "Task got lost somewhere inbetween the code of the slave service. This is a programming error. Implementation may be incomplete.");
@ -645,6 +659,9 @@ public:
CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_ABORTING); CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_ABORTING);
m_AbortRequested = true; m_AbortRequested = true;
if (m_ActiveProcess)
m_ActiveProcess->m_Aborting = true;
// ?TODO? // ?TODO?
//m_ActiveProject = NULL; //m_ActiveProject = NULL;
//m_ActiveProcess = NULL; //m_ActiveProcess = NULL;

@ -46,7 +46,7 @@ using namespace std;
namespace PIPELINE { namespace PIPELINE {
CPipelineProcessImpl::CPipelineProcessImpl(CPipelineProject *activeProject) : m_ActiveProject(activeProject), m_SubTaskResult(FINISH_NOT) CPipelineProcessImpl::CPipelineProcessImpl(CPipelineProject *activeProject) : m_ActiveProject(activeProject), m_SubTaskResult(FINISH_NOT), m_Aborting(false)
{ {
if (activeProject == NULL) if (activeProject == NULL)
{ {

@ -104,6 +104,8 @@ private:
std::set<std::string> m_ListDependentDirectories; std::set<std::string> m_ListDependentDirectories;
std::set<std::string> m_ListDependentFiles; std::set<std::string> m_ListDependentFiles;
bool m_Aborting;
private: private:
bool getDependencyFileStatusCached(CFileStatus &fileStatus, const std::string &filePath); bool getDependencyFileStatusCached(CFileStatus &fileStatus, const std::string &filePath);
bool getDependencyFileStatusLatest(CFileStatus &fileStatus, const std::string &filePath); bool getDependencyFileStatusLatest(CFileStatus &fileStatus, const std::string &filePath);

@ -506,7 +506,7 @@ void CPipelineProcessImpl::setExit(const TProcessResult exitLevel, const std::st
/// Must verify this regularly to exit the plugin in case something went wrong. /// Must verify this regularly to exit the plugin in case something went wrong.
bool CPipelineProcessImpl::needsExit() bool CPipelineProcessImpl::needsExit()
{ {
if (g_IsExiting) if (g_IsExiting || m_Aborting)
return true; return true;
// TODO: Bypass error feature. // TODO: Bypass error feature.

Loading…
Cancel
Save