Skip to content

Fix misc eiger arming issues#2052

Open
rtuck99 wants to merge 6 commits into
mainfrom
fix_misc_eiger_arming_issues
Open

Fix misc eiger arming issues#2052
rtuck99 wants to merge 6 commits into
mainfrom
fix_misc_eiger_arming_issues

Conversation

@rtuck99
Copy link
Copy Markdown
Contributor

@rtuck99 rtuck99 commented May 7, 2026

Fixes

Instructions to reviewer on how to test:

  1. Do thing x
  2. Confirm thing y happens

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.12%. Comparing base (4ba9de1) to head (57a35f5).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2052   +/-   ##
=======================================
  Coverage   99.11%   99.12%           
=======================================
  Files         327      331    +4     
  Lines       12810    12895   +85     
=======================================
+ Hits        12697    12782   +85     
  Misses        113      113           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rtuck99 rtuck99 marked this pull request as ready for review May 7, 2026 16:12
@rtuck99 rtuck99 requested a review from a team as a code owner May 7, 2026 16:12
Copy link
Copy Markdown
Contributor

@DominicOram DominicOram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions. Now we're less parallel this presumably will affect the time it takes to arm/disarm the detector. Have you investigated how much it changes throughput and agreed that the stability is preferred?

Comment thread src/dodal/devices/eiger.py Outdated
Comment on lines +229 to +232
status = self.cam.roi_mode.set(
1 if enable else 0, timeout=self.timeouts.general_status_timeout
)
status.wait(timeout=self.timeouts.general_status_timeout)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could: If we're going to wait on each individual status then we don't need to keep the status around, e.g.

Suggested change
status = self.cam.roi_mode.set(
1 if enable else 0, timeout=self.timeouts.general_status_timeout
)
status.wait(timeout=self.timeouts.general_status_timeout)
self.cam.roi_mode.set(1 if enable else 0, timeout=self.timeouts.general_status_timeout).wait(timeout=self.timeouts.general_status_timeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my question if it misses the point here. Is it possibl to improve IOC PV so the set call can rely on callback instead of wait on status, or the status already embedded callback inside?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the status is the callback from the IOC

Comment thread src/dodal/devices/eiger.py Outdated
)
status.wait(timeout=self.timeouts.general_status_timeout)
LOGGER.debug(f"Setting image_height to {detector_dimensions.height}")
status &= self.odin.file_writer.image_height.set(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: The last status has already been waited on so no need to do &= here, = will do (or just don't keep it around as above)

Comment thread src/dodal/devices/eiger.py Outdated
timeout=self.timeouts.general_status_timeout,
)
status.wait(timeout=self.timeouts.general_status_timeout)
return status
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: The only reason this returns the status is so that we can wait on it, if we've already waited on it then it seems a bit pointless

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this all goes into the list of run_functions_without_blocking() so to follow convention we return the status.

Comment thread src/dodal/devices/eiger.py Outdated
def _wait_for_odin_status(self) -> StatusBase:
self.forward_bit_depth_to_filewriter()
await_value(self.odin.meta.active, 1).wait(self.timeouts.general_status_timeout)
await_value(self.odin.meta.active, 1).wait(60)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: Can we pull this into a const?

fake_eiger.arming_status.wait(1) # This should complete long before 1s
# One log message kicking off arming, then one for each of the 13 arming stages
assert len(caplog.messages) == 14
assert len(caplog.messages) == 18
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: This no longer matches the comment above

@rtuck99
Copy link
Copy Markdown
Contributor Author

rtuck99 commented May 11, 2026

Couple of suggestions. Now we're less parallel this presumably will affect the time it takes to arm/disarm the detector. Have you investigated how much it changes throughput and agreed that the stability is preferred?

Yes, we ran it with this hotfixed, it doesn't slow things down that much. I don't have specific numbers but we think the delay is probably of the order of ~1s, judging from the archiver logs for signals. however most of that is while waiting for the robot load.
The incidence of this issue seems to have become much more frequent to the extent that without this fix, hyperion (at least on the newer versions) is almost unusable.

@DominicOram
Copy link
Copy Markdown
Contributor

The incidence of this issue seems to have become much more frequent to the extent that without this fix, hyperion (at least on the newer versions) is almost unusable.

Fair enough, it goes away with the fastCS Eiger anyway. Other comments still stand I think

@rtuck99 rtuck99 requested review from DominicOram and fajinyuan May 13, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants