Bug#642608: /usr/bin/dpkg-gencontrol: Race condition with tempfile for parallel builds

2011-10-11 Thread Raphael Hertzog
On Mon, 10 Oct 2011, Guillem Jover wrote: The correct solution would be to lock a file we know must be there, so that there's no race condition and no possible cruft leftover. For example debian/control or debian/changelog (or the file arguments specified on the command line). What do you

Bug#642608: /usr/bin/dpkg-gencontrol: Race condition with tempfile for parallel builds

2011-10-11 Thread Jonathan Nieder
Raphael Hertzog wrote: I have another idea to propose. Create debian/files.new with O_CREAT|O_EXCL and if it fails with EEXIST, sleep for Xms and try again. That sounds right to me fwiw. Fortunately dpkg-gencontrol opens $fileslistfile.new for writing before opening $fileslistfile for

Bug#642608: /usr/bin/dpkg-gencontrol: Race condition with tempfile for parallel builds

2011-10-11 Thread Guillem Jover
On Tue, 2011-10-11 at 08:34:48 +0200, Raphael Hertzog wrote: On Mon, 10 Oct 2011, Guillem Jover wrote: The correct solution would be to lock a file we know must be there, so that there's no race condition and no possible cruft leftover. For example debian/control or debian/changelog (or the

Bug#642608: /usr/bin/dpkg-gencontrol: Race condition with tempfile for parallel builds

2011-10-11 Thread Raphael Hertzog
[ CCing debian-perl for a RFP ] On Tue, 11 Oct 2011, Guillem Jover wrote: On Tue, 2011-10-11 at 08:34:48 +0200, Raphael Hertzog wrote: On Mon, 10 Oct 2011, Guillem Jover wrote: Also we should be using fcntl(2) instead of flock(2) to get NFS support, but this seems tricky on perl?

Bug#642608: /usr/bin/dpkg-gencontrol: Race condition with tempfile for parallel builds

2011-10-11 Thread Julián Moreno Patiño
Hi, The easy solution to this would seem to be to package something like the perl File::FcntlLock module: http://search.cpan.org/~jtt/File-FcntlLock-0.12/ Dear Debian perl team members, it would be nice if one of you could package this module. :-) Done[0], I am waiting to review in

Bug#642608: /usr/bin/dpkg-gencontrol: Race condition with tempfile for parallel builds

2011-10-11 Thread James Vega
On Tue, Oct 11, 2011 at 03:16:38PM +0200, Raphael Hertzog wrote: On Tue, 11 Oct 2011, Guillem Jover wrote: The easy solution to this would seem to be to package something like the perl File::FcntlLock module: http://search.cpan.org/~jtt/File-FcntlLock-0.12/ Dear Debian perl team