Commit Graph
27 Commits
Author SHA1 Message Date
leonarski_fandClaude Opus 5 db5068b2f8 tests: a puller whose queue filled must recover, not go silent
Covers the half of the deadlock fix that decides whether a collection poisons the ones after
it. outside_fifo fills whenever the detector keeps streaming past the point where the run
stopped consuming - the analysis threads have gone, and Suspend() only arrives once Stop() has
finished with the writer - and the CBOR thread then parks in PutBlocking on the full queue.
Suspend() cannot release it, since the flag is tested before the put, so ResumeAndClear at the
next start has to; nothing else ever would, because a Get on an empty queue notifies no
producer. Without that notify the puller is dead for good: cbor_fifo fills behind it, the
puller thread blocks in turn, and every later collection receives nothing at all - no images
and no start message - while the puller itself looks healthy.

The test fails with the c_full notify in ThreadSafeFIFO::Clear removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bew392LTGP2fkhfRJsMcB
2026-09-11 19:19:35 +02:00
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
leonarski_f 64002f1e29 v1.0.0-rc.129 (#36)
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 11m14s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 10m43s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m35s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 9m20s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m23s
Build Packages / Generate python client (push) Successful in 39s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m24s
Build Packages / Create release (push) Has been skipped
Build Packages / Build documentation (push) Successful in 1m0s
Build Packages / build:rpm (rocky8) (push) Successful in 10m35s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 10m35s
Build Packages / build:rpm (rocky9) (push) Successful in 11m17s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 9m9s
Build Packages / Unit tests (push) Failing after 1h18m57s
This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.124.

* jfjoch_broker: Significant improvements in TCP image socket, as a viable alternative for ZeroMQ sockets (only a single port on broker side, dynamically change number of writers, acknowledgments for written files)
* jfjoch_broker: Delta phi is calculated also for still data in Bragg prediction
* jfjoch_broker: Image pusher statistics are accessible via the REST interface
* jfjoch_writer: Supports TCP image socket and for these auto-forking option

Reviewed-on: #36
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
2026-03-05 22:13:12 +01:00
leonarski_f 4dbbf0e365 v1.0.0-rc.97
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m11s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m9s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 9m18s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 10m14s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m3s
Build Packages / Generate python client (push) Successful in 15s
Build Packages / Build documentation (push) Successful in 50s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (rocky8) (push) Successful in 8m31s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m21s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 7m42s
Build Packages / build:rpm (rocky9) (push) Successful in 9m11s
Build Packages / Unit tests (push) Failing after 1h13m19s
This is an UNSTABLE release and not recommended for production use (please use rc.96 instead).

* jfjoch_broker: For DECTRIS detectors add dark data collection during initialization for bad pixel mask
* jfjoch_broker: Refactor of calibration logic for more clear code (likely to introduce problems)
* jfjoch_viewer: Add option to handle user pixel mask (experimental)
* jfjoch_viewer: More options for ROI
* jfjoch_viewer: Add window to display calibration

Reviewed-on: #2
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
2025-11-09 12:42:27 +01:00
leonarski_f 53c90ee5d8 v1.0.0-rc.40 2025-05-28 18:49:27 +02:00
leonarski_f 040cf08386 v1.0.0-rc.36 2025-05-05 19:32:22 +02:00
leonarski_f ed89fe2619 jfjoch_test: ZMQImageCommTest_NoWriter could potentially contain values that cannot be represented by CBOR 2024-12-03 08:57:56 +01:00
leonarski_f 71290f374a version 1.0.0-rc.27 2024-12-02 21:17:14 +01:00
leonarski_f 28d224afab version 1.0.0-rc.25 2024-11-22 21:25:20 +01:00
leonarski_f 1d7e5f173d version 1.0.0-rc.18 2024-10-16 19:52:01 +02:00
leonarski_f 95eaad3d35 version 1.0.0-rc.15 2024-10-08 21:04:09 +02:00
leonarski_f e812918e2e version 1.0.0-rc.13 2024-10-05 13:14:49 +02:00
leonarski_f 949f693311 1.0.0-rc2: Fixes in preview 2024-05-16 17:41:47 +02:00
leonarski_f 91fd44bff7 Improve release/versioning of Jungfraujoch repository 2024-05-15 11:29:01 +02:00
leonarski_f ea70b27e85 Improvements before MAX IV test 2024-04-25 20:11:58 +02:00
leonarski_f 85a169ec19 Refactor how frames are sent from receiver 2024-04-14 21:47:06 +02:00
leonarski_f c6d2b5eedf File writer and spot finding improvements 2024-04-08 11:18:50 +02:00
leonarski_f d315506633 * Enhancements for XFEL
* Enhancements for EIGER
* Writer is more flexible and capable of handling DECTRIS data
2024-03-05 20:41:47 +01:00
leonarski_f f5f86d9ab6 Modifications in preparation to MAX IV experiment 2024-01-27 21:23:56 +01:00
leonarski_f f1935526a7 Generalized serializer 2023-12-11 06:49:24 +01:00
leonarski_f 552597523d ImagePusher: Serialization of StartMessage is handled outside of the class 2023-11-06 20:21:27 +01:00
leonarski_f 16bbf54f2a Remove open source license (for now) 2023-09-15 10:47:21 +02:00
leonarski_f 2c62d01759 JFJochFrameSerializer: Serializer buffer is managed externally 2023-05-09 15:36:56 +02:00
leonarski_f af2ed525a0 JFJochFrameSerializer: for the buffer return pointer + size, not vector reference (allows for more flexibility) 2023-05-01 20:26:15 +02:00
leonarski_f 0973f3725d Detector Geometry customization 2023-04-12 19:22:13 +00:00
leonarski_f aefe95920c DataMessage: use it in ZMQImagePuller, StreamWriter, HDF5DataFile, HDF5Writer 2023-04-10 21:33:36 +02:00
leonarski_f 1757d42182 Initial commit
Signed-off-by: Filip Leonarski <filip.leonarski@psi.ch>
2023-04-06 11:17:59 +02:00