ResponseNotReady (httplib exception, concurrent connections)
While trying to sync in lossy networks, from time to time I get the ResponseNotReady error again.
We are catching it on the soledad client, but I think we should be closing the socket properly before opening a new one. On tcptrack I can see that after that we have 2 open sockets in parallel, both receiving at the same time.
2013-12-26 00:15:44,211 - leap.bitmask.services.soledad.soledadbootstrapper:_try_soledad_sync:L#303 - ERROR - SSLError('The read operation timed out',) 2013-12-26 00:15:44,215 - leap.bitmask.services.soledad.soledadbootstrapper:_try_soledad_sync:L#300 - DEBUG - trying to sync soledad.... 2013-12-26 00:15:44,229 - leap.bitmask.services.soledad.soledadbootstrapper:_try_soledad_sync:L#311 - ERROR - Unhandled error while syncing soledad: ResponseNotReady() Traceback (most recent call last): File "/home/kali/leap/leap_client/src/leap/bitmask/services/soledad/soledadbootstrapper.py", line 301, in _try_soledad_sync self._soledad.sync() File "/home/kali/leap/soledad/client/src/leap/soledad/client/__init__.py", line 1089, in sync creds=self._creds, autocreate=True) File "/home/kali/leap/soledad/client/src/leap/soledad/client/sqlcipher.py", line 347, in sync res = self.syncer.sync(autocreate=autocreate) File "/home/kali/Virtualenvs/leap-bitmask/local/lib/python2.7/site-packages/u1db/sync.py", line 101, in sync self.source._replica_uid) File "/home/kali/Virtualenvs/leap-bitmask/local/lib/python2.7/site-packages/u1db/remote/http_target.py", line 46, in get_sync_info res, _ = self._request_json('GET', ['sync-from', source_replica_uid]) File "/home/kali/Virtualenvs/leap-bitmask/local/lib/python2.7/site-packages/u1db/remote/http_client.py", line 221, in _request_json content_type) File "/home/kali/leap/soledad/client/src/leap/soledad/client/target.py", line 421, in _request return self._response() File "/home/kali/leap/soledad/client/src/leap/soledad/client/target.py", line 431, in _response resp = self._conn.getresponse() File "/usr/lib/python2.7/httplib.py", line 1033, in getresponse raise ResponseNotReady() ResponseNotReady 2013-12-26 00:15:44,242 - leap.bitmask.services.soledad.soledadbootstrapper:_try_soledad_sync:L#300 - DEBUG - trying to sync soledad.... 2013-12-26 00:15:44,250 - leap.soledad.client.sqlcipher:sync:L#354 - INFO - Replacing connection and trying again... 2013-12-26 00:15:44,254 - leap:write:L#53 - DEBUG - 2013-12-26 00:15:44-0400 [-] Creating a NEW HTTP CLIENT BASE -------------------------------------------- ^C2013-12-26 00:16:41,352 - leap:sigint_handler:L#72 - DEBUG - SIGINT catched. shutting down...
If drebs takes on this and need info, I did the connection reuse, chiiph added the exception catching.
(from redmine: created on 2013-12-26)