You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Oden Eriksson <oe...@mandriva.com> on 2006/02/14 13:17:34 UTC

mutex dir?

Hello.

In our package in Mandriva I patch mod_python.c so that the mutex stuff is put 
in "/var/cache/httpd/mod_python/". But now with mod_python-3.2.7 plus fixes 
from the trunk and running the test suite it complains it cannot access 
"/var/cache/httpd/mod_python/" (of course). So my question/request is, could 
you please make this directory set in the config?

-- 
Regards // Oden Eriksson
Mandriva: http://www.mandriva.com
NUX: http://li.nux.se

Re: mutex dir?

Posted by Oden Eriksson <oe...@mandriva.com>.
tisdagen den 14 februari 2006 18.35 skrev Jim Gallacher:
> Oden Eriksson wrote:
> > tisdagen den 14 februari 2006 14.19 skrev Jim Gallacher:
> >>Oden Eriksson wrote:
> >>>Hello.
> >>>
> >>>In our package in Mandriva I patch mod_python.c so that the mutex stuff
> >>>is put in "/var/cache/httpd/mod_python/". But now with mod_python-3.2.7
> >>>plus fixes from the trunk and running the test suite it complains it
> >>>cannot access "/var/cache/httpd/mod_python/" (of course). So my
> >>>question/request is, could you please make this directory set in the
> >>>config?
> >>
> >>I assume you mean as an option to configure, rather than as an Apache
> >>configuration directive?
> >
> > I meant as an apache configuration directive.
>
> After giving this some thought I think it should be both, so the options
> become:
>
> 1. Default /tmp
>
> 2. --configure --with-mutex-dir=/some/directory
>     Allows distributions to package mod_python according to their
> platform specification, without the need for applying any patches.
>
> 3. PythonMutexDir /some/place
>     This would mainly be used in the unit tests to override the setting
>     applied by option #2. This avoids Oden's unit test problem which is
> similar to the problem described in MODPYTHON-119, where the unit test
> defaults may conflict with a mod_python instance running on the server.

Looks good to me. Please make sure the test case will survive too. Currently 
the test case fails all over the place for me... Why don't you write the test 
cases so that you can use Apache-Test?

> I wonder if we should generalize this, so rather than PythonMutexDir, we
> have PythonModuleConfig. Usage might look like:
>
> PythonModuleConfig mutex_dir /path/to/mutexs
> PythonModuleConfig max_mutex_locks 8
>
> Currently the number of mutex locks is set with ./configure
> --with-max-locks

Looks very good. I was planning to make an optional rpm build switch so that 
you could rebuild the src.rpm so that you could use any number there.

Speaking of locks, I think this could be improved a bit so that you don't have 
to use ipc for example. History has shown ipc semaphore locks are not very 
stable on linux.

> By the way Oden, are you the offical mod_python maintainer on Mandriva?

Amongst many other packages (too many), yes.

-- 
Regards // Oden Eriksson
Mandriva: http://www.mandriva.com
NUX: http://li.nux.se

Re: mutex dir?

Posted by "Gregory (Grisha) Trubetskoy" <gr...@apache.org>.
On Tue, 14 Feb 2006, Jim Gallacher wrote:

> I wonder if we should generalize this, so rather than PythonMutexDir, we have 
> PythonModuleConfig. Usage might look like:
>
> PythonModuleConfig mutex_dir /path/to/mutexs
> PythonModuleConfig max_mutex_locks 8

I may be wrong, but I think the reason this was never configurable was 
because the mutex is created before the apache config is read.

Grisha

Re: mutex dir?

Posted by Jim Gallacher <jp...@jgassociates.ca>.
Oden Eriksson wrote:
> tisdagen den 14 februari 2006 14.19 skrev Jim Gallacher:
> 
>>Oden Eriksson wrote:
>>
>>>Hello.
>>>
>>>In our package in Mandriva I patch mod_python.c so that the mutex stuff
>>>is put in "/var/cache/httpd/mod_python/". But now with mod_python-3.2.7
>>>plus fixes from the trunk and running the test suite it complains it
>>>cannot access "/var/cache/httpd/mod_python/" (of course). So my
>>>question/request is, could you please make this directory set in the
>>>config?
>>
>>I assume you mean as an option to configure, rather than as an Apache
>>configuration directive?
> 
> 
> I meant as an apache configuration directive.
> 

After giving this some thought I think it should be both, so the options 
become:

1. Default /tmp

2. --configure --with-mutex-dir=/some/directory
    Allows distributions to package mod_python according to their 
platform specification, without the need for applying any patches.

3. PythonMutexDir /some/place
    This would mainly be used in the unit tests to override the setting 
    applied by option #2. This avoids Oden's unit test problem which is 
similar to the problem described in MODPYTHON-119, where the unit test 
defaults may conflict with a mod_python instance running on the server.

I wonder if we should generalize this, so rather than PythonMutexDir, we 
have PythonModuleConfig. Usage might look like:

PythonModuleConfig mutex_dir /path/to/mutexs
PythonModuleConfig max_mutex_locks 8

Currently the number of mutex locks is set with ./configure --with-max-locks

By the way Oden, are you the offical mod_python maintainer on Mandriva?

Jim

Re: mutex dir?

Posted by Oden Eriksson <oe...@mandriva.com>.
tisdagen den 14 februari 2006 14.19 skrev Jim Gallacher:
> Oden Eriksson wrote:
> > Hello.
> >
> > In our package in Mandriva I patch mod_python.c so that the mutex stuff
> > is put in "/var/cache/httpd/mod_python/". But now with mod_python-3.2.7
> > plus fixes from the trunk and running the test suite it complains it
> > cannot access "/var/cache/httpd/mod_python/" (of course). So my
> > question/request is, could you please make this directory set in the
> > config?
>
> I assume you mean as an option to configure, rather than as an Apache
> configuration directive?

I meant as an apache configuration directive.

-- 
Regards // Oden Eriksson
Mandriva: http://www.mandriva.com
NUX: http://li.nux.se

Re: mutex dir?

Posted by Jim Gallacher <jp...@jgassociates.ca>.
Oden Eriksson wrote:
> Hello.
> 
> In our package in Mandriva I patch mod_python.c so that the mutex stuff is put 
> in "/var/cache/httpd/mod_python/". But now with mod_python-3.2.7 plus fixes 
> from the trunk and running the test suite it complains it cannot access 
> "/var/cache/httpd/mod_python/" (of course). So my question/request is, could 
> you please make this directory set in the config?
> 

I assume you mean as an option to configure, rather than as an Apache 
configuration directive?

Jim

Re: mutex dir?

Posted by Oden Eriksson <oe...@mandriva.com>.
torsdagen den 16 februari 2006 22.48 skrev Jim Gallacher:
> Oden Eriksson wrote:
> > tisdagen den 14 februari 2006 13.17 skrev Oden Eriksson:
> >>Hello.
> >
> > [...]
> >
> > I am no programmer, but can't you just look at how this is handled in the
> > core mod_ssl and ldap code?
>
> That would be cheating and no fun at all! ;)
>
> Seriously though, we do often look through the source of other modules
> for ideas and inspiration, but the code bases are different enough that
> it's not a simple cut and paste. I know it may seem like we've gone off
> on a tangent, but I think it's better to come up with a general solution
> rather than creating a bunch of special cases, each of which end up with
> a slightly different implementation.

He he he, I see. Then it wasn't just me who thought this was not a cut and 
paste thing. I also looked in many other third party modules to see if I 
could do that :)

-- 
Regards // Oden Eriksson
Mandriva: http://www.mandriva.com
NUX: http://li.nux.se

Re: mutex dir?

Posted by Jim Gallacher <jp...@jgassociates.ca>.
Oden Eriksson wrote:
> tisdagen den 14 februari 2006 13.17 skrev Oden Eriksson:
> 
>>Hello.
> 
> 
> [...]
> 
> I am no programmer, but can't you just look at how this is handled in the core 
> mod_ssl and ldap code?

That would be cheating and no fun at all! ;)

Seriously though, we do often look through the source of other modules 
for ideas and inspiration, but the code bases are different enough that 
it's not a simple cut and paste. I know it may seem like we've gone off 
on a tangent, but I think it's better to come up with a general solution 
rather than creating a bunch of special cases, each of which end up with 
a slightly different implementation.

Jim


Re: mutex dir?

Posted by Oden Eriksson <oe...@mandriva.com>.
tisdagen den 14 februari 2006 13.17 skrev Oden Eriksson:
> Hello.

[...]

I am no programmer, but can't you just look at how this is handled in the core 
mod_ssl and ldap code?


-- 
Regards // Oden Eriksson
Mandriva: http://www.mandriva.com
NUX: http://li.nux.se