I have several Gentoo machines on our network that happily sync from one machine with large amounts of disk space. I also have /usr/portage/distfiles NFS-mapped from each machine onto the sync master. However, if two machines are emerging the same program at the same time, one will find the distfile half downloaded, and abort with a checksum error, or try and resume it, with disasterous results. Could portage somehow lock out other "instances" from downloading a file, until the download is complete. I guess this would require the other instances to wait, polling a flag - every second shouldn't cause too much bother. If the download fails, another client could attempt the download. I can forsee a possible problem if the downloading instance of portage crashes, leaving the lock in place - but this won't happen right ;) I guess the ultimate solution, would be for the distfiles server to provide a distfiles-proxy, which the other portage instances can connect through when requesting distfiles, allowing the distfiles server to download the file itself, then pipe it to requesting clients. Just an idea, I don't have enough time/python experience to patch portage, but it would certainly be a useful addition in large setups, especially with nightly mass-updates. Reproducible: Always Steps to Reproduce:
Take it for a spin please, it's in pre15 now. I'd expect the locks to be screwwy on samba, should work on nfs from what I recall.
I have tried it, and it appears to work ok, though the two different instances appear to be downloading the same file at the same time. How does the new "locking" work?