requests / SSL blocks forever?
Nagy László Zsolt
gandalf at shopzeus.com
Mon Jan 15 13:30:03 EST 2018
2018. 01. 13. 15:03 keltezéssel, Jon Ribbens írta:
> On 2018-01-13, Nagy László Zsolt <gandalf at shopzeus.com> wrote:
>> I have a multi threaded Windows service written in Python. It is running
>> on 3.6.2. Sometimes I cannot stop the service, because on of the
>> threads won't exit. I have narrowed down the problem to request and
>> _lib.SSL_read.
> (a) are you setting daemon=True on the thread?
> (b) are you setting a timeout on the requests call?
The thread is not daemonic, but it can be stopped (usually) within a
second by setting a threading.Event.
I'm not setting a timeout on the call. Good point. I'm going to try it now.
By the way: yes, I have to use a service that is almost not documented,
and sometimes it disconnects in the middle of the request, only sending
half of the response. I was not thinking about not sending a reponse but
keeping the connection alive. But now that you pointed out, it is very
well possible.
Laszlo
More information about the Python-list
mailing list