traceback from hg serve

James Gregory james.jrg at gmail.com
Mon Apr 28 09:25:28 UTC 2014


Actually, updating mercurial to 2.9.1 didn't fix the error, it just so
happened to not occur for an hour after making the upgrade. Applying
the above patch also didn't make any difference. I have now changed
the line in config __init __ from:

for k in data._data:

to:

for k in data._data.copy():

to see if that helps, though I admit I have no real understanding of
what the code is actually doing. Being intermittent it kinds of looks
like it could be a concurrency bug, but I'm not sure if hg serve
actually uses threads, and even if it does I can't see how the GIL
could be released within that loop. So maybe it is not related to
threads within a single Python process but rather self._data can
somehow end up being the same as data._data when nginx makes
simultaneous requests on the mercurial web server?

On 24 April 2014 18:37, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2014-04-24 at 16:47 +0100, James Gregory wrote:
>> Mercurial: Mercurial Distributed SCM (version 2.9.1)
>> OS: Ubuntu 12.04.4 LTS
>
> Try this patch:
>
> diff -r d36440d84328 mercurial/hgweb/hgweb_mod.py
> --- a/mercurial/hgweb/hgweb_mod.py      Wed Apr 23 23:29:55 2014 +0200
> +++ b/mercurial/hgweb/hgweb_mod.py      Thu Apr 24 12:37:07 2014 -0500
> @@ -64,6 +64,7 @@
>              r = repo
>
>          r = self._getview(r)
> +        r.baseui = r.baseui.copy()
>          r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
>          r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
>          r.ui.setconfig('ui', 'nontty', 'true', 'hgweb')
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>



-- 
James



More information about the Mercurial mailing list