浏览代码

Hue - After upgrading thrift-0.16.0 version, Hue gets following error,

non-zero flags not allowed in calls to recv
Prakash Ranade 3 年之前
父节点
当前提交
7a3420012d

+ 4 - 0
desktop/core/ext-py/thrift-0.16.0/src/transport/TSocket.py

@@ -94,6 +94,10 @@ class TSocket(TSocketBase):
                 if exc.errno in (errno.EWOULDBLOCK, errno.EAGAIN):
                     return True
                 return False
+            except ValueError as e:
+                logger.debug(e)
+                # SSLSocket fails on recv with non-zero flags; fallback to the old behavior
+                return True
         finally:
             self.handle.settimeout(original_timeout)
 

+ 1 - 0
desktop/core/ext-py/thrift-0.16.0/test/test_socket.py

@@ -25,6 +25,7 @@ class TSocketTest(unittest.TestCase):
             acc.start()
 
             sock = TSocket(host="localhost", port=acc.port)
+            self.assertFalse(sock.isOpen())
             sock.open()
             sock.setTimeout(timeout)
 

+ 2 - 0
desktop/core/ext-py/thrift-0.16.0/test/test_sslsocket.py

@@ -158,7 +158,9 @@ class TSSLSocketTest(unittest.TestCase):
     def _assert_connection_success(self, server, path=None, **client_args):
         with self._connectable_client(server, path=path, **client_args) as (acc, client):
             try:
+                self.assertFalse(client.isOpen())
                 client.open()
+                self.assertTrue(client.isOpen())
                 client.write(b"hello")
                 self.assertEqual(client.read(5), b"there")
                 self.assertTrue(acc.client is not None)