feat(eiger): make the missing-packet tolerance per-detector and switchable #311

Merged
menzel merged 1 commits from fix/eiger-missing-packet-tolerance into main 2026-09-08 14:30:54 +02:00
Member

Deployed at cSAXS as cb2a38d and verified on hardware 2026-09-08 — the tolerance fired for real on scan 1051 (get_missing_packet_events() == 1, scan COMPLETED, 10/10 readouts), confirming the "Missing packets in data collection" match against live JungfrauJoch output. Follows #310, which it depends on.

Deployed at cSAXS as cb2a38d and verified on hardware 2026-09-08 — the tolerance fired for real on scan 1051 (get_missing_packet_events() == 1, scan COMPLETED, 10/10 readouts), confirming the "Missing packets in data collection" match against live JungfrauJoch output. Follows #310, which it depends on.
menzel added 1 commit 2026-09-08 14:27:49 +02:00
feat(eiger): make the missing-packet tolerance per-detector and switchable
CI for csaxs_bec / test (push) Successful in 1m51s
CI for csaxs_bec / test (pull_request) Successful in 1m49s
21a5dffdcc
The JungfrauJoch broker reports packet loss during data collection as a plain
error, which fails the scan. Since 2026-09-03 that error has been suppressed on
the beamline by an uncommitted edit, through a hardcoded flag on the Eiger base
class: it applied to every Eiger at once, it could be reached neither from the
client nor from deviceConfig, and it left nothing in the log.

The tolerance is now a real parameter, raise_on_missing_packets:

- named in Eiger, Eiger9M and Eiger1_5M, so that a deviceConfig key actually
  reaches the device. bec_server intersects config keys with the named
  parameters of the class, so a flag reachable only through **kwargs is
  silently dropped -- the same trap as readout_time (f450f29) and prefix
  (10be2b5). A test pins the signatures.
- exposed through USER_ACCESS as get_/set_raise_on_missing_packets, so a
  beamtime can change its mind without a redeployment. Like every runtime
  value it is shared between clients and does not survive a server restart;
  deviceConfig is what makes a choice stick.
- counted, and logged at warning level whenever an error is let through, so
  that "which scans were affected?" has an answer. get_missing_packet_events()
  returns the count.

What is tolerated is narrower than it looks: the frame-count check below still
raises when statistics.images_collected falls short of the trigger count. Only
"the broker flagged packet loss but delivered the expected number of images"
gets through, and a test pins that a short acquisition still fails.

The default stays False, i.e. tolerate, so the running beamtime is unaffected.
It should become True once the 9M's packet loss is understood, with
raise_on_missing_packets: false in that detector's deviceConfig if it still
needs it. That is one constant to change, RAISE_ON_MISSING_PACKETS.

The wording of the broker message is the only handle available, as there is no
error code for it. If JungfrauJoch rephrases it the match stops working and the
error raises again, which is the safe direction to fail in.

test_eiger_on_complete_error_message was skipped as failing "because the error
should be skipped for now due to HW issues". With the tolerance scoped to the
missing-packet message it passes again, and is no longer skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
menzel merged commit 653351fc15 into main 2026-09-08 14:30:54 +02:00
menzel deleted branch fix/eiger-missing-packet-tolerance 2026-09-08 14:30:54 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bec/csaxs_bec#311