From cbefbc43e945f52a7becbc8d3be770a3cca41545 Mon Sep 17 00:00:00 2001 From: AliceMazzoleni99 Date: Tue, 20 Jan 2026 17:02:27 +0100 Subject: [PATCH] Fix/mt cluster finder dropping frames (#265) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue from Jonathan. - writing to output queue did not check if queue is full - such that frames were dropped. ## Dataset to recreata issue: data overf 10G interface can be accessed on pc: pc-highz-02 raw frames: /mnt/sls_det_storage_10G/highZ_data/JMulvey/Calibration_From_HZ02/2025Jan_m343/Zr15800eV/250129_CZTsolo_Xray_Tp_15C_tint_100_master_0.json pedestal frames: /mnt/sls_det_storage_10G/highZ_data/JMulvey/Calibration_From_HZ02/2025Jan_m343/Zr15800eV/250129_CZTsolo_Pedestal_Tp_15C_tint_100_master_0.json --------- Co-authored-by: Erik Fröjdh --- RELEASE.md | 4 ++++ include/aare/ClusterFinderMT.hpp | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 0e520a2..d9c0888 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -13,6 +13,10 @@ - Removed Print/Print_some/Print_all form NDArray (operator << still works) - Added const* version of .data() +### Bugfixes: + + - multi threaded cluster finder doesnt drop frames if queues are full + ### 2025.11.21 diff --git a/include/aare/ClusterFinderMT.hpp b/include/aare/ClusterFinderMT.hpp index 42e8105..b5df766 100644 --- a/include/aare/ClusterFinderMT.hpp +++ b/include/aare/ClusterFinderMT.hpp @@ -73,8 +73,11 @@ class ClusterFinderMT { switch (frame->type) { case FrameType::DATA: cf->find_clusters(frame->data.view(), frame->frame_number); - m_output_queues[thread_id]->write( - cf->steal_clusters(realloc_same_capacity)); + while (!m_output_queues[thread_id]->write( + cf->steal_clusters(realloc_same_capacity))) { + std::this_thread::sleep_for(m_default_wait); + } + break; case FrameType::PEDESTAL: