mod_python + wsgi mercurial application and in-process hook question

Matt Mackall mpm at
Tue Sep 14 12:45:46 CDT 2010

On Tue, 2010-09-14 at 18:58 +0200, Berkes Adan wrote:
> Hi,
> This question might a bit weird but I need some clarification on this:
> There is an apache2 server which serve mercurial request through 
> mod_python. The python gateway which initiate the wsgi application sets 
> some enviroment variable which is going to be retrieved in an in-process 
> hook in certain cases.
> The question is: Is this way safe if two requests arrive at the same 
> time to the same repository in apache? So more technically: is all such 
> requests are going to be served by a separate process from mercurial 
> perspective so the enviroment variables is going to be isolated even 
> when a hook is called?

I think you'll find that WSGI 'environment variables' are passed as a
dict per request and aren't globals. But I'm not sure we make the WSGI
environment available to hooks. So I think you might get in trouble.

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial-devel mailing list