DUNE-DAQ / timinglibs

0 stars 1 forks source link

Timeout at "stop" if `FakeHSIEventGenerator` trigger rate is low #28

Closed philiprodrigues closed 2 years ago

philiprodrigues commented 3 years ago

If I set the fake hsi trigger rate very low (eg 0.01 Hz), then the fake hsi app times out at "stop", because this line is waiting in a long sleep:

https://github.com/DUNE-DAQ/timinglibs/blob/953d7f5a61181fe18d72947751b9163465b8afab/plugins/FakeHSIEventGenerator.cpp#L211

You could split up the sleep and check running_flag periodically, as done here:

https://github.com/DUNE-DAQ/trigger/blob/ae24612ebc371ac787f6fbf88896629825e286d5/plugins/TriggerPrimitiveMaker.cpp#L159

philiprodrigues commented 3 years ago

Also, using sleep_for here will result in a slightly lower-than-requested trigger rate, because the rest of the loop takes some time. Better to use sleep_until.

strilov commented 2 years ago

Closing as https://github.com/DUNE-DAQ/hsilibs/pull/5 has been merged.