Commit e8658620 authored by Andrea Orlat's avatar Andrea Orlat
Browse files

fixed issue 246

parent 0daeb933
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -106,4 +106,6 @@


<ErrorCode name="ScheduleNotExist" shortDescription="Schedule could not be found" description=""/>
<ErrorCode name="ScheduleNotExist" shortDescription="Schedule could not be found" description=""/>


<ErrorCode name="CannotClosePendingTask" shortDescription="Cannot close all pending tasks" description=""/>

</Type>
</Type>
+3 −2
Original line number Original line Diff line number Diff line
@@ -176,14 +176,15 @@ void _haltSchedule();
 * @throw ComponentErrors::CORBAProblemExImpl
 * @throw ComponentErrors::CORBAProblemExImpl
 * @throw ManagementErrors::LogFileErrorExImpl
 * @throw ManagementErrors::LogFileErrorExImpl
 * @thorw ManagementErrors::ScheduleNotExistExImpl
 * @thorw ManagementErrors::ScheduleNotExistExImpl
 * @throw ManagementErrors::CannotClosePendingTaskExImpl
*/
*/
void _startSchedule(const char* scheduleFile,const char * startSubScan) throw (ManagementErrors::ScheduleErrorExImpl,ManagementErrors::AlreadyRunningExImpl,
void _startSchedule(const char* scheduleFile,const char * startSubScan) throw (ManagementErrors::ScheduleErrorExImpl,ManagementErrors::AlreadyRunningExImpl,
		ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
		ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
		ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl);
		ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,ManagementErrors::CannotClosePendingTaskExImpl);


/**
/**
 * It allows to change the backend elected as default backend, the default backend is the device used for all operation (for example tsys) when a schedule is not running.
 * It allows to change the backend elected as default backend, the default backend is the device used for all operation (for example tsys) when a schedule is not running.
 * @param bckName name of the instance of the backend that has to be placed as default backend. It couls be also an alias assigned to this backend
 * @param bckName name of the instance of the backend that has to be placed as default backend. It could be also an alias assigned to this backend
 */
 */
void _chooseDefaultBackend(const char *bckName) throw (ComponentErrors::CouldntGetComponentExImpl,ManagementErrors::BackendNotAvailableExImpl);
void _chooseDefaultBackend(const char *bckName) throw (ComponentErrors::CouldntGetComponentExImpl,ManagementErrors::BackendNotAvailableExImpl);


+3 −1
Original line number Original line Diff line number Diff line
@@ -70,10 +70,12 @@ public:
 	 * @throw ComponentErrors::CouldntGetComponentExImpl
 	 * @throw ComponentErrors::CouldntGetComponentExImpl
 	 * @throw ComponentErrors::CORBAProblemExImpl
 	 * @throw ComponentErrors::CORBAProblemExImpl
 	 * @throw ManagementErrors::LogFileErrorExImpl
 	 * @throw ManagementErrors::LogFileErrorExImpl
 	 * @thorw ManagementErrors::CannotClosePendingTaskExImpl
 	*/
 	*/
     void startSchedule(const char* scheduleFile,const char * subScanidentifier) throw (ManagementErrors::ScheduleErrorExImpl,
     void startSchedule(const char* scheduleFile,const char * subScanidentifier) throw (ManagementErrors::ScheduleErrorExImpl,
    		 ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
    		 ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
    		 ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl);
    		 ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,
    		 ManagementErrors::CannotClosePendingTaskExImpl);
     
     
     /**
     /**
      * initialize the schedule executor.
      * initialize the schedule executor.
+1 −1
Original line number Original line Diff line number Diff line
@@ -1128,7 +1128,7 @@ void CCore::_haltSchedule()


void CCore::_startSchedule(const char* scheduleFile,const char * startSubScan) throw (ManagementErrors::ScheduleErrorExImpl,ManagementErrors::AlreadyRunningExImpl,
void CCore::_startSchedule(const char* scheduleFile,const char * startSubScan) throw (ManagementErrors::ScheduleErrorExImpl,ManagementErrors::AlreadyRunningExImpl,
		ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
		ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
		ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl)
		ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,ManagementErrors::CannotClosePendingTaskExImpl)
{
{
	//no need to get the mutex, because it is already done inside the Schedule Executor thread
	//no need to get the mutex, because it is already done inside the Schedule Executor thread
	if (m_schedExecuter) {
	if (m_schedExecuter) {
+12 −1
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ void CScheduleExecutor::runLoop()
	if (m_goAhead) {
	if (m_goAhead) {
		switch (m_stage) {
		switch (m_stage) {
			case INIT: { // run once at schedule start, it runs the init procedure, in case of errors..schedule execution is continued
			case INIT: { // run once at schedule start, it runs the init procedure, in case of errors..schedule execution is continued
				//CannotClosePendingTask
				IRA::CString procName;
				IRA::CString procName;
				if (!m_schedule->getInitProc(procName)) { //get the procedure
				if (!m_schedule->getInitProc(procName)) { //get the procedure
					//if init proc fails...warn but go ahead
					//if init proc fails...warn but go ahead
@@ -504,7 +505,8 @@ void CScheduleExecutor::initialize(maci::ContainerServices *services,const doubl
 
 
void CScheduleExecutor::startSchedule(const char* scheduleFile,const char * subScanidentifier) throw (
void CScheduleExecutor::startSchedule(const char* scheduleFile,const char * subScanidentifier) throw (
 		ManagementErrors::ScheduleErrorExImpl, ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,
 		ManagementErrors::ScheduleErrorExImpl, ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,
 		ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl)
 		ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,
 		ManagementErrors::CannotClosePendingTaskExImpl)
{
{
 	baci::ThreadSyncGuard guard(&m_mutex);
 	baci::ThreadSyncGuard guard(&m_mutex);
 	if (m_active) {
 	if (m_active) {
@@ -530,6 +532,15 @@ void CScheduleExecutor::startSchedule(const char* scheduleFile,const char * subS
 		_EXCPT(ManagementErrors::ScheduleNotExistExImpl,dummy,"CScheduleExecutor::startSchedule()");
 		_EXCPT(ManagementErrors::ScheduleNotExistExImpl,dummy,"CScheduleExecutor::startSchedule()");
 		throw dummy;
 		throw dummy;
 	}
 	}
 	ACS_LOG(LM_FULL_INFO,"CScheduleExecutor::startSchedule()",(LM_NOTICE,"Stopping all pending tasks"));
 	try {
 		m_core->closeScan(true);
 	}
 	catch (ACSErr::ACSbaseExImpl& ex) {
 		_ADD_BACKTRACE(ManagementErrors::CannotClosePendingTaskExImpl,impl,ex,"CScheduleExecutor::startSchedule()");
 		m_core->changeSchedulerStatus(Management::MNG_FAILURE);
 		throw impl;
 	}
 	try {
 	try {
 		m_schedule=new CSchedule(fullPath,schedule);
 		m_schedule=new CSchedule(fullPath,schedule);
 	}
 	}