From ff54adca428a3b15d5c8abc5f2e66f86e8d8b8b3 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Tue, 2 Nov 2021 07:13:32 +0000
Subject: [PATCH] Make sure outputProc does not hang indefinitely. Allows at
 most 8 hours of processing in non-real-time mode,but we aren't using that.
 Also improve the error message if the connection gpuproc<->outputproc is
 lost.

---
 RTCP/Cobalt/OutputProc/src/GPUProcIO.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc b/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc
index 23dbdbdeee8..6cd78f3591c 100644
--- a/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc
+++ b/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc
@@ -134,8 +134,8 @@ bool process(Stream &controlStream)
 
     setSelfDestructTimer(parset, outputProcTimeout);
   } else {
-    // Kill any existing alarms
-    alarm(0);
+    // Non-real-time behaviour: give processing at most 8 hours
+    alarm(8*3600);
   }
 
   // Send id string to the MAC Log Processor as context for further LOGs.
@@ -310,7 +310,7 @@ bool process(Stream &controlStream)
           finalMetaData.read(controlStream);
         } catch (LOFAR::Exception &err) {
           success = false;
-          LOG_ERROR_STR("Failed to read broken tile information: " << err);
+          LOG_ERROR_STR("Error in connection with GPUProc: " << err);
         }
 
         if (parset.settings.realTime) {
-- 
GitLab