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
[email protected])?

-- 
Keith Thompson (The_Other_Keith) [EMAIL PROTECTED]  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.
_______________________________________________
info-cvs mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/info-cvs

Reply via email to