Issue Details (XML | Word | Printable)

Key: MODPYTHON-131
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jim Gallacher
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Make name of mutex directory configurable.

Created: 17/Feb/06 09:55 AM   Updated: 11/Apr/07 11:25 AM
Return to search
Component/s: core
Affects Version/s: 3.2.7
Fix Version/s: 3.2.10, 3.3.1

Time Tracking:
Not Specified

Resolution Date: 12/Mar/06 05:44 AM


 Description  « Hide
Creating an issue for this so it can be tracked.

Been pointed out in:

  http://www.mail-archive.com/python-dev@httpd.apache.org/msg01271.html

that on Mandriva Linux, that is is necessary to manually change the mutex directory in mod_python.c source code. Area of code is:

  #if !defined(OS2) && !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
        char fname[255];

        snprintf(fname, 255, "/tmp/mpmtx%d%d", glb->parent_pid, n);
  #else
        char *fname = NULL;
  #endif

There should be an option to configure program to allow this to be more easily changed.

Way of changing the value through Apache configuration to also be investigated further.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jim Gallacher made changes - 06/Mar/06 08:23 AM
Field Original Value New Value
Assignee Jim Gallacher [ jgallacher ]
Repository Revision Date User Message
ASF #385000 Sat Mar 11 03:46:52 UTC 2006 jgallacher Added --with-mutex-dir configure option to make the mutex directory
configurable at compilation time (MODPYTHON-131).
Files Changed
MODIFY /httpd/mod_python/trunk/Doc/modpython2.tex
MODIFY /httpd/mod_python/trunk/configure
MODIFY /httpd/mod_python/trunk/src/mod_python.c
MODIFY /httpd/mod_python/trunk/configure.in
MODIFY /httpd/mod_python/trunk/src/include/mod_python.h.in

Jim Gallacher made changes - 11/Mar/06 11:18 AM
Status Open [ 1 ] In Progress [ 3 ]
Graham Dumpleton added a comment - 11/Mar/06 12:48 PM
In respect of:

  http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/include/mod_python.h.in?rev=385000&r1=384999&r2=385000&view=diff

I think you probably want:

/* MUTEX_DIR can be set as a configure option
 * ./configure --with-mutex-dir=/path/to/dir
 */
#define MUTEX_DIR "@MUTEX_DIR@"

Ie., quote value of macro.

And in:

  http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/mod_python.c?rev=385000&r1=384999&r2=385000&view=diff

you probably want:

        snprintf(fname, 255, "%s/mpmtx%d%d", MUTEX_DIR, glb->parent_pid, n);

Ie., MUTEX_DIR is substituted using %s, as macro will not be expanded in string.

Not sure why tests still pass with the way it was.


Repository Revision Date User Message
ASF #385154 Sat Mar 11 20:35:31 UTC 2006 jgallacher Added support for configuring the mutex directory and number of locks
at apache startup using PythonOption directives. The unit tests still need
to be refactored to take advantage of this new capability.
Ref MODPYTHON-131, MODPYTHON-145
Files Changed
MODIFY /httpd/mod_python/trunk/Doc/modpython2.tex
MODIFY /httpd/mod_python/trunk/src/include/mod_python.h
MODIFY /httpd/mod_python/trunk/src/mod_python.c
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/src/include/mod_python.h.in

Repository Revision Date User Message
ASF #385177 Sat Mar 11 21:43:05 UTC 2006 jgallacher Fixed unit tests to be compatible with the use of
PythonOption mod_python.mutex_directory. The unit tests can now
use a different mutex_directory, and there will not interfere with
a running apache instance. (MODPYTHON-131).
Files Changed
MODIFY /httpd/mod_python/trunk/test/htdocs/tests.py
MODIFY /httpd/mod_python/trunk/test/test.py

Jim Gallacher made changes - 12/Mar/06 05:44 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Fix Version/s 3.3 [ 12310101 ]
Resolution Fixed [ 1 ]
Repository Revision Date User Message
ASF #393442 Wed Apr 12 12:03:09 UTC 2006 grahamd Backported MODPYTHON-131 and MODPYTHON-145 from trunk to branches/3.2.x.
Files Changed
MODIFY /httpd/mod_python/branches/3.2.x/test/test.py
MODIFY /httpd/mod_python/branches/3.2.x/src/mod_python.c
MODIFY /httpd/mod_python/branches/3.2.x/Doc/appendixc.tex
MODIFY /httpd/mod_python/branches/3.2.x/src/include/mod_python.h.in
MODIFY /httpd/mod_python/branches/3.2.x/configure.in
MODIFY /httpd/mod_python/branches/3.2.x/test/htdocs/tests.py
MODIFY /httpd/mod_python/branches/3.2.x/configure
MODIFY /httpd/mod_python/branches/3.2.x/Doc/modpython2.tex
MODIFY /httpd/mod_python/branches/3.2.x/src/include/mod_python.h

Graham Dumpleton made changes - 12/Aug/06 07:53 AM
Fix Version/s 3.2.10 [ 12312029 ]
Graham Dumpleton made changes - 11/Apr/07 11:25 AM
Status Resolved [ 5 ] Closed [ 6 ]