From d99b4979858e7fb450f47a2ac9f557600b1504ca Mon Sep 17 00:00:00 2001 From: Andrea Orlati Date: Mon, 31 Jan 2022 18:03:34 +0100 Subject: [PATCH] fix issue #604: in case of mismatch between the projectID of the schedule header and the current ctvie project an error is (#663) thrown. The excpetion was not declared in functions signature leading to a crash. --- Common/Servers/Scheduler/include/Core_Operations.h | 3 ++- Common/Servers/Scheduler/include/ScheduleExecutor.h | 3 ++- Common/Servers/Scheduler/src/Core_Operations.i | 5 ++--- Common/Servers/Scheduler/src/ScheduleExecutor.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Common/Servers/Scheduler/include/Core_Operations.h b/Common/Servers/Scheduler/include/Core_Operations.h index 54b2cdbf4..674ff34d5 100644 --- a/Common/Servers/Scheduler/include/Core_Operations.h +++ b/Common/Servers/Scheduler/include/Core_Operations.h @@ -178,10 +178,11 @@ void _haltSchedule(); * @throw ManagementErrors::LogFileErrorExImpl * @thorw ManagementErrors::ScheduleNotExistExImpl * @throw ManagementErrors::CannotClosePendingTaskExImpl + * @throw ManagementErrors::ScheduleProjectNotMatchExImpl */ void _startSchedule(const char* scheduleFile,const char * startSubScan) throw (ManagementErrors::ScheduleErrorExImpl,ManagementErrors::AlreadyRunningExImpl, ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl, - ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,ManagementErrors::CannotClosePendingTaskExImpl); + ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,ManagementErrors::CannotClosePendingTaskExImpl,ManagementErrors::ScheduleProjectNotMatchExImpl); /** * 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. diff --git a/Common/Servers/Scheduler/include/ScheduleExecutor.h b/Common/Servers/Scheduler/include/ScheduleExecutor.h index 61122ace4..a20144e6e 100644 --- a/Common/Servers/Scheduler/include/ScheduleExecutor.h +++ b/Common/Servers/Scheduler/include/ScheduleExecutor.h @@ -72,11 +72,12 @@ public: * @throw ComponentErrors::CORBAProblemExImpl * @throw ManagementErrors::LogFileErrorExImpl * @thorw ManagementErrors::CannotClosePendingTaskExImpl + * @throw ManagementErrors::ScheduleProjectNotMatchExImpl */ void startSchedule(const char* scheduleFile,const char * subScanidentifier) throw (ManagementErrors::ScheduleErrorExImpl, ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl, ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl, - ManagementErrors::CannotClosePendingTaskExImpl); + ManagementErrors::CannotClosePendingTaskExImpl,ManagementErrors::ScheduleProjectNotMatchExImpl); /** * initialize the schedule executor. diff --git a/Common/Servers/Scheduler/src/Core_Operations.i b/Common/Servers/Scheduler/src/Core_Operations.i index 84e38722f..9893bcdbc 100644 --- a/Common/Servers/Scheduler/src/Core_Operations.i +++ b/Common/Servers/Scheduler/src/Core_Operations.i @@ -1156,12 +1156,11 @@ void CCore::_haltSchedule() void CCore::_startSchedule(const char* scheduleFile,const char * startSubScan) throw (ManagementErrors::ScheduleErrorExImpl,ManagementErrors::AlreadyRunningExImpl, ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl, - ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,ManagementErrors::CannotClosePendingTaskExImpl) + ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl,ManagementErrors::CannotClosePendingTaskExImpl, + ManagementErrors::ScheduleProjectNotMatchExImpl) { //no need to get the mutex, because it is already done inside the Schedule Executor thread if (m_schedExecuter) { - //ManagementErrors::ScheduleErrorExImpl, ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl, - //ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl m_schedExecuter->startSchedule(scheduleFile,startSubScan); } } diff --git a/Common/Servers/Scheduler/src/ScheduleExecutor.cpp b/Common/Servers/Scheduler/src/ScheduleExecutor.cpp index 14de2c323..7e01425ae 100644 --- a/Common/Servers/Scheduler/src/ScheduleExecutor.cpp +++ b/Common/Servers/Scheduler/src/ScheduleExecutor.cpp @@ -556,7 +556,7 @@ void CScheduleExecutor::initialize(maci::ContainerServices *services,const doubl void CScheduleExecutor::startSchedule(const char* scheduleFile,const char * subScanidentifier) throw ( ManagementErrors::ScheduleErrorExImpl, ManagementErrors::AlreadyRunningExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::CouldntGetComponentExImpl, ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl,ManagementErrors::ScheduleNotExistExImpl, - ManagementErrors::CannotClosePendingTaskExImpl) + ManagementErrors::CannotClosePendingTaskExImpl,ManagementErrors::ScheduleProjectNotMatchExImpl) { baci::ThreadSyncGuard guard(&m_mutex); bool projectChanged; -- GitLab