Mailing List Archive

Help with Threads and httplib please
Hello,

I have a weird problem running several python threads that use httplib
to get some pages from the web. all runs ok, until suddenly all the
threads get stuck. A ctrl-c makes them all continue, until the next time
they're stuck again.

From what I saw in the debugger, it seems that one thread is stuck in
the "connect" of the socket under httplib, and all the other threads are
waiting for some reason.

Has anyone seen this problem or has an idea? I am using Linux (RedHat 6)
and Python 1.52 with gcc 2.95

Thanks,
Yishai Beeri
Help with Threads and httplib please [ In reply to ]
In article <37B9A587.3160428E@platonix.com>,
Yishai Beeri <yishai@platonix.com> wrote:
>
>I have a weird problem running several python threads that use httplib
>to get some pages from the web. all runs ok, until suddenly all the
>threads get stuck. A ctrl-c makes them all continue, until the next time
>they're stuck again.
>
From what I saw in the debugger, it seems that one thread is stuck in
>the "connect" of the socket under httplib, and all the other threads are
>waiting for some reason.

We're having similar problems in a slightly different context. I don't
have a complete answer yet, but part of the problem has to do with not
setting up the socket with a timeout. Another part seems to be with
using blocking mode.

One thing we've definitely noticed is that if the server terminates the
socket *after* starting to send information but *before* all info has
been transmitted, the client will hang.
--
--- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6 (if you want to know, do some research)