Skip to content

Commit 44060a4

Browse files
committed
Catch socket.timeout in ThriftConnection
Fixes elastic#121, thanks traxair!
1 parent 8869497 commit 44060a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elasticsearch/connection/thrift.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import absolute_import
2+
from socket import timeout as SocketTimeout
23
import time
34

45
try:
@@ -61,7 +62,7 @@ def perform_request(self, method, url, params=None, body=None, timeout=None, ign
6162
tclient = self._get_connection()
6263
response = tclient.execute(request)
6364
duration = time.time() - start
64-
except TException as e:
65+
except (TException, SocketTimeout) as e:
6566
self.log_request_fail(method, url, body, time.time() - start, exception=e)
6667
raise ConnectionError('N/A', str(e), e)
6768
finally:

0 commit comments

Comments
 (0)