title: SqlAlchemy / PyMysql connection timeout on SSCursor
body: <p>I am using sqlalchemy to connect mysql database. My code looks like</p>
  
  <pre><code>engine = sqlalchemy.create_engine(sqlalchemy.engine.url.URL(**url), connect_args={'cursorclass': SSCursor})
  conn = engine.connect()
  </code></pre>
  
  <p>Since it is necessary to obtain huge amount of data from DB at once, I used SSCursor. I did some investigation and I create a scenario where connection is lost after 60 second. It is simulated by simple code, I add timeout(60). I am getting a traceback like following:</p>
  
  <pre><code>Exception during reset or similar
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 687, in _finalize_fairy
      fairy._reset(pool)
    File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 829, in _reset
      pool._dialect.do_rollback(self)
    File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/dialects/mysql/base.py", line 1598, in do_rollback
      dbapi_connection.rollback()
    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 788, in rollback
      self._execute_command(COMMAND.COM_QUERY, "ROLLBACK")
    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 1067, in _execute_command
      raise err.InterfaceError("(0, '')")
  pymysql.err.InterfaceError: (0, '')
  Exception ignored in: &lt;bound method MySQLResult.__del__ of &lt;pymysql.connections.MySQLResult object at 0x7fed3af0d828&gt;&gt;
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 1332, in __del__
    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 1434, in _finish_unbuffered_query
    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 983, in _read_packet
    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 1014, in _read_bytes
  AttributeError: 'NoneType' object has no attribute 'settimeout'
  </code></pre>
  
  <p>I am not able to figure out, how to ensure that connection will time out after different desired time. I tried to use <code>connect_timeout</code> in <code>connect_args</code> with no change in behavior. </p>
  
  <p>What should I do to ensure connection?</p>
  
  <p>Thanks</p>