Skip to content

If detector misses a trigger then it waits forever without timeout #1114

@huw-dls

Description

@huw-dls

If we make our triggers too close together then the detector will only produce half the images required, then stall waiting for another trigger. This is meant to be caught by the timeout observing the number of frames written, but the following code catches that and waits for the detector to be idle:

try:
async for index in indices_written:
yield WatcherUpdate(
name=self.name,
current=index,
initial=self._initial_frame,
target=self._events_to_complete,
unit="",
precision=0,
time_elapsed=time.monotonic() - self._fly_start
if self._fly_start
else None,
)
if index >= self._events_to_complete:
break
finally:
await indices_written.aclose()
if self._completable_exposures >= trigger_info.total_number_of_exposures:
self._completable_exposures = 0
self._events_to_complete = 0
self._number_of_events_iter = None
await self._controller.wait_for_idle()

This will never happen as it is waiting for a trigger.

This needs investigating as to why the finally block was added, and another way of doing this found.

Acceptance Criteria

  • Raises TimeoutError if HDF writer stalls even if detector is still active

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions