blissdata: dynamic_hdf5 "is finished" race condition
Reported by @retegan
with dynamic_hdf5.File(filename_in) as nxroot_in:
nxentry_in = nxroot_in[scan]
nxentry_in["end_time"] # wait until scan is fully written >>> has a race condition
I1 = nxentry_in[f"instrument/{self.inputs.i1name}/data"][()]
I0 = nxentry_in[f"instrument/{self.inputs.i0name}/data"][()]
I1norm = I1 / I0
The race condition is here:
try:
... # nxentry_in["end_time"]
except KeyError as e:
# in this time "end_time" is created
if self._is_finished(item):
# we raise an exception for done nxentry_in["end_time"] as a result of "end_time" being present
# the solution is the try one more time before raising an exception
raise RetryTimeoutError(str(e)) from e
raise
Edited by Wout De Nolf