runzhliu opened a new issue #923:
URL: https://github.com/apache/incubator-kyuubi/issues/923


   ### 1. Describe the bug
   
   When we use the pyhive to connect to kyuubi server, and then submit two SQLs 
serially, it would accidentally throw the exception like `Read a negative frame 
size (-2147418110)!`.
   
   <!-- A clear and concise description of what the bug is. -->
   
   ### 2. Environments
   
   #### 2.1 Versions
   
   - Kyuubi
     - [x] 1.1.0
     - [ ] 1.0.3
     - [ ] 0.8.x and earlier <!-- Please update Kyuubi, versions of 0.x are no 
longer supported by the community -->
   
   - Spark
     - [ ] 3.1.x
     - [x] 3.0.x
     - [ ] 2.4.x and earlier <!-- Please update Spark, versions of 2.x are no 
longer supported by the community -->
   
   #### 2.2 Kyuubi Configurations
   
   #### 2.3 Spark Configurations
   
   ### 3. Steps to reproduce
   
   Assumed `sql` is a very complicated SQL that would take most of the 
resources.
   
   ```python
   from pyhive import hive
   from TCLIService.ttypes import TOperationState
   
   conn = hive.connect(host = 'x.x.x.x', port = 10009)
   cursor1 = conn.cursor()
   cursor1.execute(sql,async = True)
   
   cursor2 = conn.cursor()
   cursor2.execute("select 1+1",async = True)
   ```
   
   #### 3.1 Operations
   
   #### 3.2 Expected behavior
   
   <!-- A clear and concise description of what you expected to happen. -->
   
   #### 3.3 Actual behavior
   
   ### 4. Additional context
   
   #### 4.1 Log of the server
   
   ```
   2021-08-12 13:14:26,273 INFO  org.apache.kyuubi.operation.ExecuteStatement   
               - Processing hadoop's 
query[37979e47-2797-4d9b-8b23-84df220c2b29]: INITIALIZED_STATE -> 
PENDING_STATE, statement: select timestamp '2018-11-17';
   2021-08-12 13:14:26,273 DEBUG org.apache.thrift.transport.TSaslTransport     
               - writing data length: 128
   2021-08-12 13:14:26,274 DEBUG org.apache.thrift.transport.TSaslTransport     
               - CLIENT: reading data length: 109
   2021-08-12 13:14:26,274 DEBUG org.apache.thrift.transport.TSaslTransport     
               - writing data length: 109
   2021-08-12 13:14:26,274 INFO  org.apache.kyuubi.operation.ExecuteStatement   
               - Processing hadoop's 
query[37979e47-2797-4d9b-8b23-84df220c2b29]: PENDING_STATE -> RUNNING_STATE, 
statement: select timestamp '2018-11-17';
   2021-08-12 13:14:26,274 DEBUG org.apache.thrift.transport.TSaslTransport     
               - SERVER: reading data length: 139
   2021-08-12 13:14:26,275 DEBUG org.apache.kyuubi.service.FrontendService      
               - 
TExecuteStatementReq(sessionHandle:TSessionHandle(sessionId:THandleIdentifier(guid:88
 F0 88 6A 9E F6 42 E7 90 A8 0C 3E 7E 96 0B 6C, secret:1B 9A 9D 6C F0 5A 40 46 
8C 73 A3 8F A7 CA 24 7F)), statement:select timestamp '2018-11-17';, 
runAsync:true, queryTimeout:0)
   2021-08-12 13:14:26,275 DEBUG org.apache.thrift.transport.TSaslTransport     
               - writing data length: 100
   2021-08-12 13:14:26,275 INFO  org.apache.kyuubi.operation.log.OperationLog   
               - Creating operation log file 
/tmp/hsperfdata_hadoop/operation_logs/88f0886a-9ef6-42e7-90a8-0c3e7e960b6c/ee010e16-5abd-4da3-a20b-7d2b008d37ec
   2021-08-12 13:14:26,276 INFO  org.apache.kyuubi.operation.ExecuteStatement   
               - Processing hadoop's 
query[ee010e16-5abd-4da3-a20b-7d2b008d37ec]: INITIALIZED_STATE -> 
PENDING_STATE, statement: select timestamp '2018-11-17';
   2021-08-12 13:14:26,276 DEBUG org.apache.thrift.transport.TSaslTransport     
               - writing data length: 128
   2021-08-12 13:14:27,077 DEBUG org.apache.thrift.transport.TSaslTransport     
               - CLIENT: reading data length: 79
   2021-08-12 13:14:27,077 INFO  org.apache.kyuubi.operation.ExecuteStatement   
               - Processing hadoop's 
query[ee010e16-5abd-4da3-a20b-7d2b008d37ec]: PENDING_STATE -> ERROR_STATE, 
statement: select timestamp '2018-11-17';, time taken: 1.628745267077E9 seconds
   2021-08-12 13:14:27,077 WARN  org.apache.kyuubi.service.FrontendService      
               - Error executing statement:
   org.apache.kyuubi.KyuubiSQLException: Error operating EXECUTE_STATEMENT: 
Read a negative frame size (-2147418110)!
        at 
org.apache.kyuubi.KyuubiSQLException$.apply(KyuubiSQLException.scala:51)
        at 
org.apache.kyuubi.operation.KyuubiOperation$$anonfun$onError$1.applyOrElse(KyuubiOperation.scala:59)
        at 
org.apache.kyuubi.operation.KyuubiOperation$$anonfun$onError$1.applyOrElse(KyuubiOperation.scala:44)
        at 
scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
        at 
org.apache.kyuubi.operation.ExecuteStatement.executeStatement(ExecuteStatement.scala:70)
        at 
org.apache.kyuubi.operation.ExecuteStatement.runInternal(ExecuteStatement.scala:130)
        at 
org.apache.kyuubi.operation.AbstractOperation.run(AbstractOperation.scala:130)
        at 
org.apache.kyuubi.session.AbstractSession.runOperation(AbstractSession.scala:93)
        at 
org.apache.kyuubi.session.AbstractSession.$anonfun$executeStatementInternal$1(AbstractSession.scala:121)
        at 
org.apache.kyuubi.session.AbstractSession.withAcquireRelease(AbstractSession.scala:76)
        at 
org.apache.kyuubi.session.AbstractSession.executeStatementInternal(AbstractSession.scala:118)
        at 
org.apache.kyuubi.session.AbstractSession.executeStatementAsync(AbstractSession.scala:137)
        at 
org.apache.kyuubi.service.AbstractBackendService.executeStatementAsync(AbstractBackendService.scala:67)
        at 
org.apache.kyuubi.service.FrontendService.ExecuteStatement(FrontendService.scala:250)
        at 
org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1437)
        at 
org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1422)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
        at 
org.apache.kyuubi.service.authentication.TSetIpAddressProcessor.process(TSetIpAddressProcessor.scala:36)
        at 
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
   Caused by: org.apache.thrift.transport.TTransportException: Read a negative 
frame size (-2147418110)!
        at 
org.apache.thrift.transport.TSaslTransport.readFrame(TSaslTransport.java:456)
        at 
org.apache.thrift.transport.TSaslTransport.read(TSaslTransport.java:435)
        at 
org.apache.thrift.transport.TSaslClientTransport.read(TSaslClientTransport.java:37)
        at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
        at 
org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
        at 
org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
        at 
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:219)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:77)
        at 
org.apache.hive.service.rpc.thrift.TCLIService$Client.recv_ExecuteStatement(TCLIService.java:237)
        at 
org.apache.hive.service.rpc.thrift.TCLIService$Client.ExecuteStatement(TCLIService.java:224)
        at 
org.apache.kyuubi.operation.ExecuteStatement.executeStatement(ExecuteStatement.scala:67)
        ... 18 more
   2021-08-12 13:14:27,078 DEBUG org.apache.thrift.transport.TSaslTransport     
               - writing data length: 3317
   2021-08-12 13:14:27,114 INFO  org.apache.kyuubi.service.FrontendService      
               - Session [SessionHandle [88f0886a-9ef6-42e7-90a8-0c3e7e960b6c]] 
disconnected without closing properly, close it now
   2021-08-12 13:14:27,114 INFO  org.apache.kyuubi.session.KyuubiSessionManager 
               - SessionHandle [88f0886a-9ef6-42e7-90a8-0c3e7e960b6c] is 
closed, current opening sessions 1
   2021-08-12 13:14:27,115 DEBUG org.apache.thrift.transport.TSaslTransport     
               - writing data length: 96
   
   ```
   
   #### 4.2 Log of the corresponding engine


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to