pretxnchangegroup hook fails because it can't acquire lock

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Nov 5 03:06:11 CST 2013


On 5 nov. 2013, at 03:16, Mick Jordan wrote:

> I have a pretxnchangegroup hook on a repo 'x' that runs a python script that, essentially, calls "hg push x-2', where other tests runs to determine whether the changegroup should be accepted. The repo is on a server that is receiving the push via http, using Apache 2.2 and hgweb. All the repo files are group apache and the owner of the files is trusted in the apache user .hgrc file. The system is essentially a Red Hat Linux 6.
> 
> Mercurial is 2.2.2 and running under Python 2.6.6, which is the default installed Python. The hook script is running under python2.7.5, as it needs features from that version.
> 
> First, 'hg outgoing http://x' works fine, so the basic permissions are correct (it too a while to get that far).
> 
> However, the 'hg push http://x'  does not. The "hg push x-2" in the hook hangs waiting for the lock on 'x' and eventually times out. I can see the lock file in 'x/.hg/store' which is a symbolic link to the python process running hgweb.cgi (and hence the hook). Now, almost exactly the same configuration exists on another machine, running slightly different versions of Apache, hg, Linux and python and works flawlessly. So what is the problem on my machine? Does 'push' really need the lock? Is it yet another weird permissions problem?
> 
> I can verify in another shell that I can clone 'x' to, say, 'y', but if I also explicitly attempt to then  'hg push 'y' ', I get the same 'waiting for lock message'.
> 
> Someone who understand the Mercurial locking system please explain why this works on one machine but not another?

from mercurial 2.1, hg push lock the repo (because push may change local phases). We made that optional (it push anyway if it fails to lock) in 2.6

-- 
Pierre-Yves


More information about the Mercurial mailing list