[mod_python] ValueError: Failed to acquire global mutex lock

Graham Dumpleton graham.dumpleton at gmail.com
Wed Oct 17 18:22:31 EDT 2007


On 17/10/2007, Michael Robokoff <mike.robokoff at apioutsourcing.com> wrote:
> Graham, Thanks so much for your help, unfortunately I don't think it
> made any difference. I don't see any real change in error messages.
> Should I check on how to increase the semaphores at the system level?

What do the messages in the Apache error log indicate about how many
mutexes mod_python is actually using? The directive must be in the
correct context else it is ignored.

> [Tue Oct 16 06:36:49 2007] [warn] (45)Deadlock situation detected/avoided:
> Failed to acquire global mutex lock at index 2

This error message possibly indicates the problem as being due to
something else.

One suggestion is to set the Apache configuration directive AcceptMutex.

  http://httpd.apache.org/docs/2.2/mod/mpm_common.html#acceptmutex

Set it to:

  AcceptMutex flock

This may not change the lock type used by mod_python though because of
it how it wrongly indicates which type of lock to use:

  https://issues.apache.org/jira/browse/MODPYTHON-202

It may release more semaphores though for use.

BTW, in apr.h in Apache include directory, what are the following set
to for your system.

#define APR_USE_FLOCK_SERIALIZE           0
#define APR_USE_SYSVSEM_SERIALIZE         1
#define APR_USE_POSIXSEM_SERIALIZE        0
#define APR_USE_FCNTL_SERIALIZE           0
#define APR_USE_PROC_PTHREAD_SERIALIZE    0
#define APR_USE_PTHREAD_SERIALIZE         1

#define APR_HAS_FLOCK_SERIALIZE           1
#define APR_HAS_SYSVSEM_SERIALIZE         1
#define APR_HAS_POSIXSEM_SERIALIZE        1
#define APR_HAS_FCNTL_SERIALIZE           1
#define APR_HAS_PROC_PTHREAD_SERIALIZE    0

Graham

> --Mike
>
>
> -----Original Message-----
> From: Graham Dumpleton [mailto:graham.dumpleton at gmail.com]
> Sent: Tuesday, October 16, 2007 7:29 AM
> To: Michael Robokoff
> Cc: mod_python
> Subject: Re: [mod_python] ValueError: Failed to acquire global mutex lock
>
> Your system has a low number of sysvsem's configured and it is running
> out. Whether you use prefork or worker shouldn't matter. You can
> change the number that mod_python uses, setting it to a lower value
> using the directive:
>
>   PythonOption mod_python.mutex_locks 4
>
> Must be defined at global scope in Apache configuration. Check Apache
> error logs to see if it works.
>
> Note, you must be using mod_python 3.3.1.
>
> Graham
>
> On 16/10/2007, Michael Robokoff <mike.robokoff at apioutsourcing.com> wrote:
> >
> >
> >
> >
> > Hello,
> >
> > I just changed from running apache configured with "mpm=prefork" to
> > "mpm=worker".
> >
> > Everything worked with the "prefork" attribute. We decided to change over
> to
> > multi threading
> >
> > to test performance, so I recompiled apache with the "worker" attribute.
> Now
> > we get the error
> >
> >
> >
> > [error] [client]   File
> > "/usr/local/lib/python2.5/site-packages/mod_python/Session.py",
> > line 280, in lock\n
> > _apache._global_lock(self._req.server, self._sid), referer:
> > http://......
> >
> >
> >
> > "ValueError: Failed to acquire global mutex lock" referer: http:...
> >
> >
> >
> > Can you please give me some direction on this.
> >
> >
> >
> >
> >
> >
> >
> > Michael Robokoff
> >
> > Senior Systems Administrator
> >
> > API Outsourcing
> >
> >
> >
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
> >
>
>
>
>


More information about the Mod_python mailing list