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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
1 parent
7adc7c1348
commit
29afe06a78
1 file changed
+1
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user