[Bug 5106] New: race condition because outgoing hooks are run too early
mercurial-bugs at selenic.com
mercurial-bugs at selenic.com
Thu Feb 18 07:55:27 UTC 2016
https://bz.mercurial-scm.org/show_bug.cgi?id=5106
Bug ID: 5106
Summary: race condition because outgoing hooks are run too
early
Product: Mercurial
Version: 3.7.1
Hardware: PC
OS: Windows
Status: UNCONFIRMED
Severity: bug
Priority: normal
Component: Mercurial
Assignee: bugzilla at selenic.com
Reporter: andrew10 at gfreys.com
CC: mercurial-devel at selenic.com
This is not a recent regression - I hit it in 3.0, and upgraded to check it
still repros. I see no workaround (if I'm going to continue to use Windows and
not set up an ssh/https server).
I set up an 'outgoing' hook to trigger a Jenkins job when I do "hg push".
I noticed that often (~30% of the time), Jenkins doesn't trigger the job.
Digging into logs, I see that it always triggers a poll, but when the problem
happens, the poll doesn't see any changes. I tried adding a sleep at the start
of the hook, but it didn't help.
>From adding a long 'sleep' to the hook and watching the hg log, I've determined
that the hook runs at this point in the hg log output:
searching for changes
---> HOOK RUNS HERE
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
whereas I expect it to run at the end.
This seems to explain the problem I'm having.
I am running 3.7.1 (installed as part of TortoiseHg) on Windows 10.
The source repository is on a local folder, the destination is an SMB share on
another Windows machine. Here's my hook (with a long sleep thrown in):
outgoing.jenkins = powershell -NoProfile -ExecutionPolicy ByPass -Command
"start-sleep -Milliseconds 5000; $dummy = (new-object
System.Net.WebClient).DownloadData('http://<mymachine>:8080/mercurial/notifyCommit?url=<myurl>')"
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Mercurial-devel
mailing list