mercure-imaging / mercure

mercure DICOM Orchestrator
https://mercure-imaging.org
MIT License
65 stars 31 forks source link

Incoming series are not taken into account in determining whether a study is completed #32

Closed rogerbramon closed 2 years ago

rogerbramon commented 2 years ago

Describe the bug The router may consider a study as completed even if there are incoming series for that study. The router checks the study.last_receive_time to determine whether it reached the timeout and consider it completed. However, study.last_receive_timeis only updated once a series is completed. Thus, you could have a large series incoming for a given study and the route_studies method may eventually consider the study as completed since the router doesn't take into account uncompleted series. That forces to define high timeout values, since is complicated to predict the maximum time needed to receive a series.

To Reproduce

  1. Define a short study timeout, e.g. 20s.
  2. Define a rule that triggers on study completed
  3. Send a study with 2 series minimum, and one of them needs to be large (or simulate a slow connection)
  4. Router will trigger the rule before both series are received.

Expected behavior A study should be considered completed when its series are marked as completed.

tblock79 commented 2 years ago

Addressed with commit ad39ae8cfa9803e85d9db8ad67093a07a09df5dc

rogerbramon commented 2 years ago

Thanks @tblock79! I'll pull master branch and give it a try.