From 8f0125244a33e996161d67cb2f95ca2d7c4de4f8 Mon Sep 17 00:00:00 2001 From: Christoffer Fremling Date: Wed, 21 Oct 2026 16:57:04 +0300 Subject: [PATCH] sequencerd: stop slicecamd's fine acquisition when the wait for it times out do_slicecam_fineacquire gave up waiting at ACQUIRE_TIMEOUT but never sent "fineacquire stop", so slicecamd's run went on until the next slew stopped it (move_to_target stops fine acquisition before moving). After a timeout in manual observing, "continue" therefore exposed while slicecamd kept moving the telescope: 2026-08-12, timeout 03:39:28, WTP18aaipkr exposing from 03:39:54, corrections at 03:40:00 and 03:40:32 and a lock at 03:40:47, stopped only at 04:19:22. An abort does not stop it either (it does so only inside the fine-acquire wait), and a repeat target never slews. The timeout branch now stops it. Co-Authored-By: Claude Opus 5.5 --- sequencerd/sequence_acquisition.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sequencerd/sequence_acquisition.cpp b/sequencerd/sequence_acquisition.cpp index 057d2063..e732371b 100644 --- a/sequencerd/sequence_acquisition.cpp +++ b/sequencerd/sequence_acquisition.cpp @@ -198,6 +198,15 @@ namespace Sequencer { if (!this->is_fineacquire_locked.load()) { if (use_timeout && std::chrono::steady_clock::now() >= timeout_time) { logwrite( function, "ERROR slicecam fine acquisition timed out!" ); + // Giving up the wait does not end slicecamd's run, and nothing else + // would before the next slew: after "continue" it would keep moving + // the telescope through the exposure (a repeat target never slews). + // Stop it here. do_slicecam_stop takes fineacquire_mtx itself, and + // with no lock its wait is satisfied at once. + lock.unlock(); + if ( this->do_slicecam_stop() != NO_ERROR ) { + this->broadcast.warning( function, "could not stop fine acquisition after the timeout" ); + } return TIMEOUT; } logwrite( function, "ERROR slicecam fine acquisition stopped without locking" );