From 9a1ab5189f441653cc586472476ceafc251de1a5 Mon Sep 17 00:00:00 2001 From: belforte Date: Wed, 12 Jan 2022 10:51:04 +0100 Subject: [PATCH] protect against probe jobs returning no events. Fix #6926 --- src/python/TaskWorker/Actions/PreDAG.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/python/TaskWorker/Actions/PreDAG.py b/src/python/TaskWorker/Actions/PreDAG.py index a1fa998b07..108f1e9481 100644 --- a/src/python/TaskWorker/Actions/PreDAG.py +++ b/src/python/TaskWorker/Actions/PreDAG.py @@ -208,12 +208,18 @@ def executeInternal(self, *args): sumEventsThr += throughput sumEventsSize += eventsize count += 1 - eventsThr = sumEventsThr / count - eventsSize = sumEventsSize / count + if count > 0: + eventsThr = sumEventsThr / count + eventsSize = sumEventsSize / count self.logger.info("average throughput for %s jobs: %s evt/s", count, eventsThr) self.logger.info("average eventsize for %s jobs: %s bytes", count, eventsSize) + if eventsThr == 0: + retmsg = "Splitting failed because all probe jobs failed or anyhow failed to provide estimates" + self.logger.error(retmsg) + return 1 + maxSize = getattr(config.TaskWorker, 'automaticOutputSizeMaximum', 5 * 1000**3) maxEvents = (maxSize / eventsSize) if eventsSize > 0 else 0