浏览代码

HUE-7456 [core] Do not retry Thrift call on read operation timed out from ssl.SSLError

Romain Rigaux 8 年之前
父节点
当前提交
8f98962748
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      desktop/core/src/desktop/lib/thrift_util.py

+ 2 - 1
desktop/core/src/desktop/lib/thrift_util.py

@@ -43,6 +43,7 @@ from desktop.lib.thrift_.TSSLSocketWithWildcardSAN import TSSLSocketWithWildcard
 from desktop.lib.thrift_sasl import TSaslClientTransport
 from desktop.lib.exceptions import StructuredException, StructuredThriftTransportException
 
+
 # The maximum depth that we will recurse through a "jsonable" structure
 # while converting to thrift. This prevents us from infinite recursion
 # in the case of circular references.
@@ -465,7 +466,7 @@ class SuperClient(object):
           raise
         self.transport.close()
 
-        if isinstance(e, socket.timeout):
+        if isinstance(e, socket.timeout) or 'read operation timed out' in str(e): # Can come from ssl.SSLError
           logging.warn("Not retrying thrift call %s due to socket timeout" % attr)
           raise
         else: