I originally posted an issue on the plone.recipe.haproxy github, but I think this is actually probably an issue with buildout. I'm using zc.buildout 2.5.2 for reference. The original post I made is quoted below. Anyway, looking into it a bit more I think it's a problem with buildout because the
My problem is that I will sometimes run buildout to update or add a python egg, but even though I have changed nothing with my haproxy part configs it will try to rebuild (why?). This in itself isn't so bad, but the rebuild process tries to delete ./parts/haproxy-build/sbin, where there is an NFS file lock because the process is running. I can't delete this and thus rebuild until I stop the running process, so now I have a few minutes downtime on my site to rebuild haproxy. Not good!
It doesn't matter that I run this with ${buildout:location}/bin/haproxy because that is just a wrapper for running the file in sbin.
As you can see it's trying to uninstall:
Uninstalling haproxy-build.
While:
Installing.
Uninstalling haproxy-build.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "[redacted]/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1992, in main
getattr(buildout, command)(args)
File "[redacted]/lib/python2.7/site-packages/zc/buildout/buildout.py", line 605, in install
self._uninstall_part(part, installed_part_options)
File "[redacted]/lib/python2.7/site-packages/zc/buildout/buildout.py", line 731, in _uninstall_part
installed_part_options[part]['__buildout_installed__'])
File "[redacted]/lib/python2.7/site-packages/zc/buildout/buildout.py", line 840, in _uninstall
rmtree(f)
File "[redacted]/lib/python2.7/site-packages/zc/buildout/rmtree.py", line 60, in rmtree
shutil.rmtree (path, onerror = retry_writeable)
File "/usr/local/python-2.7.10/lib/python2.7/shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "/usr/local/python-2.7.10/lib/python2.7/shutil.py", line 256, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "[redacted]/lib/python2.7/site-packages/zc/buildout/rmtree.py", line 58, in retry_writeable
func (path)
OSError: [Errno 39] Directory not empty: '[redacted]/parts/haproxy-build/sbin'
I just don't get why. I didn't change anything about this, in fact all I did was update a pinned version number of some python egg. Are there any known bugs with buildout being overly aggressive with uninstalls? My plan is to take the haproxy parts out of my main buildout (my buildout.cfg extends haproxy.cfg where those parts are defined) at least.