[issue3401] HgWeb.cgi Hanging During Push

Aaron Jensen bugs at mercurial.selenic.com
Wed Apr 25 17:52:48 CDT 2012


New submission from Aaron Jensen <ajensen at webmd.net>:

We’re running Mercurial 2.1.1 under IIS using CGI on Windows 2008.  We have 
two server-side 
hooks (written in PowerShell) that run on pretxnchangegroup that can take up 
to a minute to 
run.  

We’re noticing that if developer #2 pushes while developer #1 is pushing 
(his python.exe CGI 
process has locked the repo and our hooks are running), as expected, 
developer #2’s CGI process 
sits and waits for developer #1’s push to finish.  However, once developer 
#1’s push succeeds, 
developer #2’s CGI process doesn’t detect that the repo is 
available/unlocked, and never locks 
the repo or runs any hooks.  It just hangs, using no CPU or increasing in 
memory.

I would expect that developer #2 would get a message about “waiting for 
lock” message, but the 
last message Mercurial outputs is “searching for changes”.  Hitting CTRL+C 
doesn’t stop the 
push.  Developer #2 has to kill hg.exe, or I have to log into our Mercurial 
server and kill 
developer #2’s CGI process.  No repository corruption occurs on either the 
client or the 
server.

# Steps to Reproduce

On the server:

> hg init push-hangs
> cd push-hangs
> echo '[hooks]' > .hg\hgrc
> echo 'pretxnchangegroup.sleep = echo. | powershell -NoProfile -Command 
"Start-Sleep -Seconds 
10"' >> .hg\hgrc

On the client:
> hg clone http://server/push-hangs
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> hg clone http://server/push-hangs push-hangs2
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> cd push-hangs
> echo '' > a.txt
> hg add a.txt
> hg commit -m "Adding file."
> cd ..\push-hangs2
> echo '' > b.txt
> hg add b.txt
> hg commit -m "Adding file."
> hg push

While that is pushing, within ten seconds, open a new console:
> cd push-hangs
> hg push

Notice that when the first push finishes, the second hangs and never 
finishes.

----------
messages: 19755
nosy: splatteredbits
priority: bug
status: unread
title: HgWeb.cgi Hanging During Push

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3401>
____________________________________________________


More information about the Mercurial-devel mailing list