SAR-ARD/s1ard

prevent race conditions in parallel jobs

johntruckenbrodt opened this issue · 1 comments

The processor may be run in multiple parallel jobs with overlaps in scene selection. For example:

  • a job 1 might process an NRB tile, which overlaps with two scenes scene 1 and scene 2
  • job 1 starts processing scene 1
  • meanwhile, job 2 starts processing scene 2
  • job 1 finished processing scene 1 and now wants to generate the NRB product
  • however, if job 2 is not finished with scene 2, job 1 will fail when reading the output of scene 2

Similar situations can arise from GRD buffering, which output from multiple scenes and from WBM tiling (see issue #153).

A possible solution could be to introduce file locks (e.g. via the filelock library). However, this might not apply to files written by SNAP and locking a whole folder would be better.

This has mostly been fixed by implementing file locking in #192. However, only the most prominent cases have been protected with locked files and other situations might arise in the future for which this has to be implemented as well.