Comment 18 for bug 1908452

Revision history for this message
dann frazier (dannf) wrote :

Here's a similar report of pythonssl hanging in the handshake:
  https://bugs.python.org/issue34438

Suggestion there from upstream is to add a timeout.

simplestreams seems to be using a requests object to make the connection. From simplestreams/contentsource.py:

381 self.req = requests.get(url, stream=True, auth=auth, headers=headers)

And while I'm not sure this is the canonical docs for this version, I did come across a statement at https://requests.readthedocs.io/en/master/user/quickstart/ that says:

= Note =
timeout is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for timeout seconds (more precisely, if no bytes have been received on the underlying socket for timeout seconds). If no timeout is specified explicitly, requests do not time out.

So it seems like adding a timeout might be the way to go. I'm not sure at what layer though - should simplestreams hardcode one itself? Should it allow one to be passed in?