osync icon indicating copy to clipboard operation
osync copied to clipboard

Lock file prevents syncing even with old invalid pid

Open robspearman opened this issue 4 years ago • 1 comments

Describe the bug If a sync is interrupted, the lock file with an out of date pid remains in the filesystem. (Worst case is that a user unplugs a USB drive during a sync or power is lost.)

To Reproduce Steps to reproduce the behavior:

  1. Have a directory to sync with an osync working directory "lock" file with an old pid.
  2. Try to sync and get fatal error that "There is already a local instance"...

Expected behavior If there is no actual osync process matching the lock file pid then the error is incorrect and the real issue is that the last sync did not complete, and different logic should apply (give correct warning, retry, etc.).

Desktop (please complete the following information): Linux.

Additional context I am trying to protect against non-technical users getting themselves stuck.

robspearman avatar Aug 03 '20 18:08 robspearman

Sorry for the (very) late answer. Have you tried setting FORCE_STRANGER_LOCK_RESUME=true in config ?

The logic seems good to me (https://github.com/deajan/osync/blob/8451024ae27aad7bc2db5d4f7e93b0a19f1078aa/osync.sh#L3148 ) unless you use a different INSTANCE_ID than the previous sync. That's the case for which the above setting is designed for.

deajan avatar Sep 23 '20 21:09 deajan