From d27b92a26a3dbe4f9e0e70e90cf7edf6357134dd Mon Sep 17 00:00:00 2001 From: Antoine Jacquin Date: Mon, 7 Sep 2026 21:20:19 +0200 Subject: [PATCH] Add wall-clock timeout to parallel worker pool Prevents indefinite hang if a worker gets stuck (deadlocked PDAL, I/O stall). 2-hour safety net for the entire batch; remaining futures are cancelled on timeout. --- lidar_pipeline/pipeline.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lidar_pipeline/pipeline.py b/lidar_pipeline/pipeline.py index 0701c90..533be08 100644 --- a/lidar_pipeline/pipeline.py +++ b/lidar_pipeline/pipeline.py @@ -587,8 +587,14 @@ class LidarArchaeoPipeline: for file_idx, laz_file in enumerate(files) } done = 0 + t_deadline = time.time() + 7200 try: for future in as_completed(future_to_file): + if time.time() > t_deadline: + logger.error("Délai dépassé (2h) — annulation des workers restants") + for f in future_to_file: + f.cancel() + break laz_file = future_to_file[future] done += 1 try: