From e6c01e14711b9da9bf4bf21ef9dd9212903d8d4e Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Thu, 23 Jan 2020 15:17:11 +0100
Subject: [PATCH] do not propagate DataValidity::faulty flag if device is not
 yet open

---
 include/TriggerFanOut.h           | 7 +------
 src/ExceptionHandlingDecorator.cc | 1 -
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/include/TriggerFanOut.h b/include/TriggerFanOut.h
index 0275d74e..66a189d1 100644
--- a/include/TriggerFanOut.h
+++ b/include/TriggerFanOut.h
@@ -95,11 +95,6 @@ namespace ChimeraTK {
       retry:
         try {
           if(!_deviceModule.device.isOpened()) {
-            if(lastValidity == DataValidity::ok) {
-              lastValidity = DataValidity::faulty;
-              version = externalTrigger->getVersionNumber();
-              boost::fusion::for_each(fanOutMap.table, SendDataToConsumers(version, DataValidity::faulty));
-            }
             Application::getInstance().testableModeUnlock("waitForDeviceOpen");
             boost::this_thread::sleep(boost::posix_time::millisec(DeviceOpenTimeout));
             Application::getInstance().testableModeLock("waitForDeviceOpen");
@@ -118,7 +113,7 @@ namespace ChimeraTK {
         }
         // send the version number to the consumers
         boost::fusion::for_each(fanOutMap.table, SendDataToConsumers(version));
-        // wait for external trigger
+        // wait for external trigger (exception handling is done here by the decorator)
         boost::this_thread::interruption_point();
         Profiler::stopMeasurement();
         externalTrigger->read();
diff --git a/src/ExceptionHandlingDecorator.cc b/src/ExceptionHandlingDecorator.cc
index 6eaec36a..92b1ae29 100644
--- a/src/ExceptionHandlingDecorator.cc
+++ b/src/ExceptionHandlingDecorator.cc
@@ -58,7 +58,6 @@ namespace ChimeraTK {
             deviceModule.writeAfterOpen.push_back(this->_recoveryAccessor);
             return false;
           }
-          setOwnerValidityFunction(DataValidity::faulty);
           Application::getInstance().testableModeUnlock("waitForDeviceOpen");
           boost::this_thread::sleep(boost::posix_time::millisec(DeviceOpenTimeout));
           Application::getInstance().testableModeLock("waitForDeviceOpen");
-- 
GitLab