GitHub user voyageth opened a pull request:

    https://github.com/apache/zeppelin/pull/1144

    add try-catch in close() method.

    ### What is this PR for?
    Fix bug on JdbcInterpreter when hive server restarted.
    each connection.close() should be wraped by try-catch.
    
    ### What type of PR is it?
    Bug Fix
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/ZEPPELIN-1128
    
    ### How should this be tested?
    Restart hive while zeppelin still alive.
    
    After that, Zeppelin notebook's hive query execution will be fail
    
![error](https://cloud.githubusercontent.com/assets/366810/16649904/3071ec56-4476-11e6-9d13-75d4fa0f8f4f.PNG)
    
    Stacktrace is like this. 
    It was HiveInterpreter because i use zeppelin by yum install on centos(some 
old version).
    But JdbcInterpreter & HiveInterpreter's close() method is same.
    
    > ERROR [2016-07-07 18:23:46,676] ({pool-1-thread-2} 
HiveInterpreter.java[close]:166) - Error while closing...
    java.sql.SQLException: Error while cleaning up the server resources
            at 
org.apache.hive.jdbc.HiveConnection.close(HiveConnection.java:721)
            at 
org.apache.zeppelin.hive.HiveInterpreter.close(HiveInterpreter.java:151)
            at 
org.apache.zeppelin.interpreter.ClassloaderInterpreter.close(ClassloaderInterpreter.java:88)
            at 
org.apache.zeppelin.interpreter.LazyOpenInterpreter.close(LazyOpenInterpreter.java:78)
            at 
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer.close(RemoteInterpreterServer.java:232)
            at 
org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService$Processor$close.getResult(RemoteInterpreterService.java:1432)
            at 
org.apache.zeppelin.interpreter.thrift.RemoteInterpreterService$Processor$close.getResult(RemoteInterpreterService.java:1417)
            at 
org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
            at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
            at 
org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:285)
            at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.thrift.transport.TTransportException: 
java.net.SocketException: Broken pipe
            at 
org.apache.thrift.transport.TIOStreamTransport.flush(TIOStreamTransport.java:161)
            at 
org.apache.thrift.transport.TSaslTransport.flush(TSaslTransport.java:501)
            at 
org.apache.thrift.transport.TSaslClientTransport.flush(TSaslClientTransport.java:37)
            at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:65)
            at 
org.apache.hive.service.cli.thrift.TCLIService$Client.send_CloseSession(TCLIService.java:177)
            at 
org.apache.hive.service.cli.thrift.TCLIService$Client.CloseSession(TCLIService.java:169)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:497)
            at 
org.apache.hive.jdbc.HiveConnection$SynchronizedHandler.invoke(HiveConnection.java:1380)
            at com.sun.proxy.$Proxy0.CloseSession(Unknown Source)
            at 
org.apache.hive.jdbc.HiveConnection.close(HiveConnection.java:719)
            ... 12 more
    Caused by: java.net.SocketException: Broken pipe
            at java.net.SocketOutputStream.socketWrite0(Native Method)
            at 
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
            at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
            at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
            at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
            at 
org.apache.thrift.transport.TIOStreamTransport.flush(TIOStreamTransport.java:159)
            ... 24 more
    
    
    ### Screenshots (if appropriate)
    
![error](https://cloud.githubusercontent.com/assets/366810/16649904/3071ec56-4476-11e6-9d13-75d4fa0f8f4f.PNG)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/voyageth/zeppelin patch-2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/1144.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1144
    
----
commit b3d0ef61cb0588c17b629facc927bb31d624513f
Author: SungjuKwon <sungju.k...@campmobile.com>
Date:   2016-07-07T10:04:06Z

    add try-catch in close() method.
    
    each connection.close() should be wraped by try-catch.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to