From 29afe06a78ee6cec6d6cb91a42dc88873d669223 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 7 Nov 2026 18:08:49 +0100 Subject: [PATCH] JFJochReceiverService::Start: the receiver goes first when the start fails If std::async throws after the receiver is built, the catch reset the puller while the receiver's threads were still polling it. It can only happen on thread or resource exhaustion. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK --- receiver/JFJochReceiverService.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/receiver/JFJochReceiverService.cpp b/receiver/JFJochReceiverService.cpp index bac0c12dd..d3eb2cdea 100644 --- a/receiver/JFJochReceiverService.cpp +++ b/receiver/JFJochReceiverService.cpp @@ -193,6 +193,7 @@ void JFJochReceiverService::Start(const DiffractionExperiment &experiment, measurement = std::async(std::launch::async, &JFJochReceiverService::FinalizeMeasurement, this); state = ReceiverState::Running; } catch (const std::exception &e) { + receiver.reset(); // its threads may be polling the puller reset below // The receiver never started, so drop the status its base constructor had already reset - // otherwise /status and /statistics keep reporting a zero-progress run that never happened, // until the next start overwrites it.