On Wed, Sep 01, 2004 at 10:17:34AM +0100, Chris Withers wrote:
Paul Winkler wrote:
1) an External Method was making an http request using httplib to a host that had become (wrongly) firewalled. I don't know how this could completely block zope, but that was the behavior I observed. A bit of using gcc as described in the "Debug a Spinning Zope" article helped me identify the ext. method in question and rewrite it so it can't possibly block like that.
This sounds like something that should be discussed on zope-dev, but if it comes down to something C-ish blocking python's thread stuff, then ti may even end up on python-dev...
I don't think it's really a problem anymore: I was using either urllib or urllib2 (don't remember). At that time (python 2.1), socket.setdefaulttimeout() did not exist so any request to a socket could potentially spin forever. My theory is that, each time a request came for my external method, the current worker thread was then waiting forever for a reply from the firewalled socket. So, inevitably, sooner or later all threads were doing this and the server was effectively hung. But, I haven't been able to reproduce this behavior today with Zope 2.7.2, even with socket.setdefaulttimeout(None). I've currently got 16 pending requests for the never-finishing external method, and I can still browse zope just fine. -- Paul Winkler http://www.slinkp.com