fix(lamni): tolerate transient GUI heartbeat race, fix sample-name prompt order #289

Merged
holler merged 1 commits from fix/lamni-xrayeye-gui-heartbeat-retry into main 2026-07-30 16:10:32 +02:00
Member

xrayeye_rotation_center_calibration_isolated/smear_experimental() reproducibly
crashed with "RuntimeError: GUI is not alive" when keep_shutter_open=True, right
after a long blocking device move (interferometer feedback reset, live rotation
sweep). Root cause: bec_widgets' GUI liveness check is a Redis heartbeat with a
10s TTL refreshed from the same Qt event loop that renders live-view frames;
with live view left on continuously, a long blocking move can starve that
heartbeat past its TTL even though the GUI process is still alive. Add
_gui_call_with_retry() and use it at the on_live_view_enabled(True) call sites
that follow these blocking waits, so the transient false negative is retried
instead of crashing the calibration.

Also reorder the sample-name prompt in find_rotation_center() and
find_rotation_center_smear_experimental() to run before the alignment GUI is
shown -- showing the GUI first steals OS focus, forcing the operator to click
back to the terminal to answer the prompt.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

xrayeye_rotation_center_calibration_isolated/smear_experimental() reproducibly crashed with "RuntimeError: GUI is not alive" when keep_shutter_open=True, right after a long blocking device move (interferometer feedback reset, live rotation sweep). Root cause: bec_widgets' GUI liveness check is a Redis heartbeat with a 10s TTL refreshed from the same Qt event loop that renders live-view frames; with live view left on continuously, a long blocking move can starve that heartbeat past its TTL even though the GUI process is still alive. Add _gui_call_with_retry() and use it at the on_live_view_enabled(True) call sites that follow these blocking waits, so the transient false negative is retried instead of crashing the calibration. Also reorder the sample-name prompt in find_rotation_center() and find_rotation_center_smear_experimental() to run before the alignment GUI is shown -- showing the GUI first steals OS focus, forcing the operator to click back to the terminal to answer the prompt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
holler added 1 commit 2026-07-30 16:08:44 +02:00
fix(lamni): tolerate transient GUI heartbeat race, fix sample-name prompt order
CI for csaxs_bec / test (pull_request) Successful in 1m46s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 1s
CI for csaxs_bec / test (push) Successful in 1m46s
fa30e11b3c
xrayeye_rotation_center_calibration_isolated/smear_experimental() reproducibly
crashed with "RuntimeError: GUI is not alive" when keep_shutter_open=True, right
after a long blocking device move (interferometer feedback reset, live rotation
sweep). Root cause: bec_widgets' GUI liveness check is a Redis heartbeat with a
10s TTL refreshed from the same Qt event loop that renders live-view frames;
with live view left on continuously, a long blocking move can starve that
heartbeat past its TTL even though the GUI process is still alive. Add
_gui_call_with_retry() and use it at the on_live_view_enabled(True) call sites
that follow these blocking waits, so the transient false negative is retried
instead of crashing the calibration.

Also reorder the sample-name prompt in find_rotation_center() and
find_rotation_center_smear_experimental() to run before the alignment GUI is
shown -- showing the GUI first steals OS focus, forcing the operator to click
back to the terminal to answer the prompt.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
holler scheduled this pull request to auto merge when all checks succeed 2026-07-30 16:08:52 +02:00
holler merged commit fa30e11b3c into main 2026-07-30 16:10:32 +02:00
holler deleted branch fix/lamni-xrayeye-gui-heartbeat-retry 2026-07-30 16:10:32 +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#289