[mod_python] ioerrors with worker thread mpm

Michael Barton mike at weirdlooking.com
Wed Dec 10 22:57:13 EST 2008


Yes, sorry.  The exceptions I've seen are raised by sendall and recv
on socket objects inside httplib, which is connected to a service.  I
can reproduce this with a very simple handler like,

  from mod_python import apache
  from socket import socket

  def handler(req):
      s = socket()
      s.connect(('localhost', 80))
      s.recv(1024)
      return apache.OK

Make a request to that handler, which will obviously not return any
time soon.  Then hit the server enough times that it reaches
MaxRequestsPerChild.  And,

...
  File "/home/redbo/test/modpython_handler.py", line 7, in handler\n
 s.recv(1024)
error: (4, 'Interrupted system call')



On Wed, Dec 10, 2008 at 9:19 PM, Graham Dumpleton
<graham.dumpleton at gmail.com> wrote:
> Blocking i/o operations against what? Sockets you have created off to
> something else????
>
> 2008/12/11 Michael Barton <mike at weirdlooking.com>:
>> Hey list!
>>
>> I'm having a problem adapting a mod_python-based app to work with
>> Apache's worker thread mpm.
>>
>> When the process hits MaxRequestsPerChild under a high concurrency of
>> requests, blocking i/o operations in other threads on that child raise
>> exceptions (mostly EINTR or EAGAIN IOErrors in httplib).
>>
>> It looks like system calls are being interrupted by signals Apache
>> uses to control its children.  But that seems like a problem that
>> would have come up before, and I can't find much by searching the web
>> or list archives.
>>
>> I figured I'd punt to the list and see if anyone has other thoughts.
>>
>> My setup is: debian, apache 2.2.3, mod_python 3.3.1, python 2.4.4
>>
>> --Mike
>> _______________________________________________
>> 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