[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"waiting for lock" -- but I don't want to wait!

From: Keith Thompson
Subject: "waiting for lock" -- but I don't want to wait!
Date: Fri, 30 Jun 2006 04:34:11 GMT
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I recently ran into a problem with a "cvs diff" command executed from
a cron job.  Apparently the command had quietly died at some point,
leaving a lock in place.  After that, every time the cron job tried to
execute the "cvs diff" command, it would get the dreaded "waiting for
<user>'s lock" message, and retry every 30 seconds.

Since the cron job redirects the output of the cvs command to
/dev/null, I wasn't seeing the messages.  Eventually I had hundreds of
pending "cvs diff" commands running, using up all the system's cron
slots.  I had to kill several hundred processes and manually remove
the lock.

So, my question is, how can I invoke "cvs diff" (or "cvs whatever")
*without* having it wait for the lock?  If the file is locked, I want
the command to bail out with an error message rather than waiting and
trying again.  Either that, or I want to be able to specify a maximum
amount of time it will wait before giving up.  (If I were running it
manually, I could just kill the process, but that doesn't help for the
situation I've just run into.)

I've looked at the documentation and at the source (src/lock.c), and
it doesn't look like there's any straightforward way to do this.

I'll probably implement a timeout, killing the command if it hasn't
terminated after, say, 60 seconds (I'm running "cvs diff" from a Perl
script, so that won't be too difficult).  But it would be really nice
to have a command-line option to do this more directly.

Is there something I've missed?  If not, is there any reason *not* to
add this feature to CVS?  If it's not a horrible idea, what's the best
way to suggest it?  Should I post this to gnu.cvs.bug (gatewayed to

Keith Thompson (The_Other_Keith) address@hidden  <>
San Diego Supercomputer Center             <*>  <>
We must do something.  This is something.  Therefore, we must do this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]