Pinto icon indicating copy to clipboard operation
Pinto copied to clipboard

When there is a lockfile timeout, show the pid of the process that holds the lock

Open thaljef opened this issue 10 years ago • 7 comments

Maybe even offer to steal the lock if the process appears dead. Beware of NFS situations, where the process could be on another server.

thaljef avatar Mar 24 '15 07:03 thaljef

Also a good option could be --retry-forever So if we can't get the lock, we retry until we got it.

We have made automatic injection system, that grep the error and loop until it works. We a --retry-forever option it would ease that situation.

celogeek avatar Apr 10 '15 10:04 celogeek

Retrying forever seems a bit dubious to me. There is a PINTO_LOCKFILE_TIMEOUT environment variable you can set though. Not sure if that is documented.

thaljef avatar Apr 22 '15 17:04 thaljef

can we set PINTO_LOCKFILE_TIMEOUT=-1 or =0 mean forever ?

The forever is more because we have numerous to work on pinto, and it has no queue for processing. So trying to steal lock as soon as possible could be great. But we need to complete the operation under an automatic process.

celogeek avatar Apr 23 '15 05:04 celogeek

looks like File::NFSLock supports stale_lock_timeout, could expose it via PINTO_ env and document interaction if ultimate goal is not "wait forever" but "wait suitably long, then steal the lock"

also, with a (very) quick look at File::NFSLock internals, i don't see it setting the holder pid on failure - a chicken/egg issue for reporting it on failure

cakirke avatar May 05 '15 01:05 cakirke

can we set PINTO_LOCKFILE_TIMEOUT=-1 or =0 mean forever ?

Yes, it looks like 0 means forever.

thaljef avatar May 05 '15 02:05 thaljef

i don't see it setting the holder pid on failure - a chicken/egg issue for reporting it on failure.

I think we'll just have to parse that from the contents of the lock file itself (or patch File::NFSLock).

thaljef avatar May 05 '15 02:05 thaljef

proposed https://github.com/hookbot/File-NFSLock/pull/3, if accepted, it should cover the reporting issue. continuing with the stale lock/steal lock portion of this.

cakirke avatar May 08 '15 12:05 cakirke