blocked on futex

Aahz aahz at pythoncraft.com
Fri Mar 20 15:22:05 CET 2009


[posted and e-mailed, please respond to newsgroup]

In article <2961e0af-d99b-4d5e-a280-f521ce7fa384 at e10g2000vbe.googlegroups.com>,
msoulier  <msoulier at digitaltorque.ca> wrote:
>
>I'm using the Python packaged with CentOS 4.7, which is a patched
>2.3.4. Yes, ancient but I can't do anything about it.

That's not ancient -- maybe middle-aged.  ;-)

>The problem is that my long-running process, which talks to PostgreSQL
>via Django models, does a lot of reading and writing to and from the
>disk and writes to a Unix domain socket is randomly locking up. I have
>not found a consistent place in my code where this lock-up occurs, but
>every time it does, an strace shows that it is sitting at an futex()
>call, apparently waiting forever.
>
>My first guess is that futex() is being used by pthread_mutex_lock()
>for thread-safety. I'm not using threads but the interpreter was built
>with threaded support AFAIK.

How many processes do you have running?  What kind of guarantee do you
have that there's only one process if you think there should be only one?
What's on the other side of the socket?  If there's no consistent place,
is it always the same object type involved or function/method call?  I'm
not at all familiar with Django, but it might be using threads
internally.

Have you tried dumping core and using gdb to find out more about the
process state?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Programming language design is not a rational science. Most reasoning
about it is at best rationalization of gut feelings, and at worst plain
wrong."  --GvR, python-ideas, 2009-3-1



More information about the Python-list mailing list