[cvsnt] Lock directories stay on forever...

Bo Berglund bo.berglund at telia.com
Fri Oct 31 17:22:55 GMT 2003


On Fri, 31 Oct 2003 16:23:21 +0000, Tony Hoyle <tmh at nodomain.org>
wrote:

>I've started getting loads of them since install cvsmailer (None
>between july and a week ago, then about a dozen a day since) -
>possibly it's hanging around too long and preventing the server from
>cleaning up?
>
>Hmm...
>
>Committing a file creates a directory called #<number># and the cvs
>temp directory.  The temp directory doesn't go away, but its contents
>do.
>
>Disabling cvsmailer in loginfo means only the cvs temp directory
>appears, and it vanishes almost instantly.
>

It works like this:
- On the first call to CvsMailer from loginfo on a commit I will
evaluate the $CVSPID, use it to get the process start time (in
nanoseconds), then create a fairly unique marker value off of this and
use it in the creation of a temporary dir below the CVSMailer temp
dir. (#<large number>#)
- Then I also launch a second instance of CVSMailer with a delay
parameter that immediately puts it to sleep for some time to come.
- Then I process the commit info and create a few temp files in the
temp dir where the commit info is saved until later.
- I then exit the first instance of CVSMailer and CVSNT continues by
launcing a new instance for the next folder to process.
- This instance senses that it is not first by detecting the presence
of a lockfile in the temp dir created above. So it just processes the
info and quits.
- Etc, etc
- Then the sleeping instance wakes up and it goes directly to the temp
dir and collects all the info into an email, sends it off and then
clears the temp dir (but only if the flag for temp dir erasure is set
in the ini file).

I use this trick with the timestamp in order to manage simultaneous
calls from several cvs commit threads. Each such is directed to its
own temp directory.

So I guess one reason the dirs linger on is that the ini file flag is
not set for erasure. Also I recommend to use a separate temp dir for
CVSMailer.

What I don't know is why the existence of CVSMailer should affect
CVSNT in its erasure of temp files. Note that the "sleeping" instance
is not owned by the CVSNT thread, I disconnect this when I launch that
process.

/Bo


/Bo
(Bo Berglund, developer in Sweden)


More information about the cvsnt mailing list