Files
Jungfraujoch/common
leonarski_fandClaude Opus 5 c40e0eb11d broker: fix deadlock when re-initialising after a DECTRIS run that never started
A re-initialisation left the previous run's ZMQImagePuller connected: JFJochServices::On
replaces its own shared_ptr, but JFJochReceiverService keeps a second reference to the puller
of the last run. Two PULL sockets on one PUSH peer share messages round-robin, so the orphaned
puller silently took half of the DECTRIS stream - the start message included - and the receiver
then waited for a start message that had already been discarded.

Once such a run was cancelled, nothing drained the orphaned puller's outside_fifo any more. Its
CBOR thread parked in PutBlocking on the full queue (suspend is only tested before the put), the
puller thread backed up behind it in cbor_fifo, and neither could reach the disconnect flag
again. The next JFJochReceiverService::Start dropped the last reference to that puller, so
~ZMQImagePuller joined two threads that could never exit - while holding state_mutex, inside a
calibration sequence that itself holds the state machine's mutex. The whole control plane froze
with no way to cancel; only a restart got out of it.

* ThreadSafeFIFO gains Stop(), which releases every waiter and makes further blocking operations
  return at once. Clear() now notifies c_full as well: clearing a full queue used to leave the
  blocked producer asleep, since the next Get on an empty queue notifies no one.
* ZMQImagePuller::Disconnect and TCPImagePuller::Disconnect stop their queues before joining, so
  a puller whose consumer is gone can always shut down.
* JFJochServices::On and ::Off disconnect the previous puller explicitly rather than relying on
  the shared_ptr going away, so two readers never share the detector stream.

ZMQImagePuller_DisconnectWithFullQueue covers the shutdown; it hangs on the previous code.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bew392LTGP2fkhfRJsMcB
2026-09-11 18:53:39 +02:00
..
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-04-29 09:50:50 +02:00
2026-09-09 07:25:13 +02:00
2026-03-05 22:13:12 +01:00
2026-06-08 08:30:35 +02:00
2026-09-02 21:17:31 +02:00
2026-08-13 17:03:10 +02:00
2026-08-13 17:03:10 +02:00
2025-05-28 18:49:27 +02:00
2026-08-25 08:21:39 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-05-28 18:48:35 +02:00
2026-05-28 18:48:35 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-08-27 22:16:54 +02:00
2026-08-27 22:16:54 +02:00
2026-08-27 22:16:54 +02:00
2026-04-29 09:50:50 +02:00
2026-06-08 08:30:35 +02:00
2026-09-09 07:25:13 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2026-06-08 08:30:35 +02:00
2026-04-16 11:59:59 +02:00
2026-06-08 08:30:35 +02:00
2026-06-08 08:30:35 +02:00
2025-11-19 09:40:50 +01:00
2026-06-08 08:30:35 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-04-29 09:50:50 +02:00
2026-06-08 08:30:35 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-08-25 08:21:39 +02:00
2026-08-25 08:21:39 +02:00
2026-09-02 21:17:31 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2026-09-02 21:17:31 +02:00
2026-08-13 17:03:10 +02:00
2026-08-13 17:03:10 +02:00
2026-07-19 09:39:28 +02:00
2026-06-08 08:30:35 +02:00
2026-08-13 17:03:10 +02:00
2026-06-08 08:30:35 +02:00
2026-08-25 08:21:39 +02:00
2026-08-25 08:21:39 +02:00
2026-09-02 21:17:31 +02:00
2026-06-08 08:30:35 +02:00
2026-06-08 08:30:35 +02:00
2026-02-01 13:29:33 +01:00
2026-06-23 20:29:49 +02:00
2026-06-08 08:30:35 +02:00
2026-04-29 09:50:50 +02:00
2026-06-08 08:30:35 +02:00
2026-09-02 21:17:31 +02:00
2026-09-09 07:25:13 +02:00
2024-12-02 21:17:14 +01:00
2026-06-08 08:30:35 +02:00
2026-09-02 21:17:31 +02:00
2026-06-23 20:29:49 +02:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2026-08-27 22:16:54 +02:00
2025-09-22 19:49:39 +02:00
2026-06-08 08:30:35 +02:00
2026-04-16 11:59:59 +02:00
2026-06-08 08:30:35 +02:00
2026-04-16 11:59:59 +02:00
2026-06-08 08:30:35 +02:00
2026-09-02 21:17:31 +02:00
2026-06-08 08:30:35 +02:00
2026-06-23 20:29:49 +02:00
2026-06-08 08:30:35 +02:00
2026-08-25 08:21:39 +02:00
2026-08-25 08:21:39 +02:00
2026-08-25 08:21:39 +02:00
2026-09-09 07:25:13 +02:00
2026-06-08 08:30:35 +02:00
2026-06-08 08:30:35 +02:00
2026-09-09 07:25:13 +02:00
2026-08-13 17:03:10 +02:00
2026-09-02 21:17:31 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2024-12-08 13:26:13 +01:00
2026-06-08 08:30:35 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-23 20:29:49 +02:00
2026-06-08 08:30:35 +02:00
2026-08-13 17:03:10 +02:00
2026-09-02 21:17:31 +02:00
2025-06-15 17:46:46 +02:00
2026-09-09 07:25:13 +02:00
2026-09-09 07:25:13 +02:00
2026-06-08 08:30:35 +02:00
2025-09-08 20:28:59 +02:00
2026-06-08 08:30:35 +02:00
2026-04-16 11:59:59 +02:00
2026-06-08 08:30:35 +02:00
2026-08-25 08:21:39 +02:00
2026-06-23 20:29:49 +02:00
2025-12-12 21:24:20 +01:00
2026-06-08 08:30:35 +02:00
2026-05-28 18:48:35 +02:00
2026-05-28 18:48:35 +02:00
2025-09-21 19:27:51 +02:00
2026-06-08 08:30:35 +02:00
2026-08-13 17:03:10 +02:00
2026-06-08 08:30:35 +02:00
2026-04-16 11:59:59 +02:00
2026-06-08 08:30:35 +02:00