celery/py-amqp — pull request #34 by cjellick (2014-02-26 20:29:48+00:00)
Title: Don't disconnect transport on SSL read timeout

SSL socket read timeouts are not raised as socket.timeout exceptions.
So, to have SSL socket read timeouts behave the same way as TCP socket
read timeouts, we need to find them based off of their text and reraise
as socket.timeout exceptions.

This is similar to the fix in read_timeout in connection.py at:
https://github.com/celery/py-amqp/blob/1.4/amqp/connection.py#L336-L337
and in fact the exception raised here is eventually caught by
read_timeout and replaced with a socket.timeout exception. The problem
is that the transport is already marked as disconnected at that point.
So, we need to catch the timeout here in transport.py