johntruckenbrodt / pyroSAR

framework for large-scale SAR satellite data processing
MIT License
494 stars 110 forks source link

Handling of outdated lock files #309

Open johntruckenbrodt opened 3 months ago

johntruckenbrodt commented 3 months ago

https://github.com/johntruckenbrodt/pyroSAR/pull/294 saw the introduction of a lock mechanism. It may occur, that lock files are not properly deleted by the process that created them. For example when the process is killed by a HPC job manager.
There has to be a mechanism that enables their deletion. For example, write the timeout time to the file so that another process can read the value and check whether the file is older than the timeout time and then delete it. For this to work, the Lock class has to raise an error when the timeout is reached. Currently the timeout only applies to wait time for acquiring a lock, not to the existence of the lock file itself.