This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new e158a3e  [ZEPPELIN-3946] Fixed zeppelin hive interpreter broken pipe 
issue
e158a3e is described below

commit e158a3e97a0b57e92c1f2a165433dbbdac166106
Author: Xun Liu <[email protected]>
AuthorDate: Fri May 31 12:37:58 2019 +0800

    [ZEPPELIN-3946] Fixed zeppelin hive interpreter broken pipe issue
    
    ### What is this PR for?
    Upon raising the concern (ZEPPELIN-3860), we were suggested to upgrade the 
zeppelin service from 0.7.3 to 0.8.0 version. With the current zeppelin version 
i.e 0.8.0 the frequency of broken pipe error has gone up.
    
    When connecting to a database through a database connection pool, If there 
is no sql operation for a long time, The database connection pool will actively 
close this connection. The connection between the client and the database is 
broken.
    
    So by increasing
    ```
    poolableConnectionFactory.setValidationQuery("show databases");
    ```
    Periodically call the `show databases` statement, Keep the connection to 
the database.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-3946
    
    ### How should this be tested?
    The user passed the actual test, Verification solves this problem.
    [CI Pass](https://travis-ci.org/liuxunorg/zeppelin/builds/539529259)
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions?  no
    * Does this needs documentation? no
    
    Author: Xun Liu <[email protected]>
    
    Closes #3374 from liuxunorg/ZEPPELIN-3946 and squashes the following 
commits:
    
    f2877fd4b [Xun Liu] [ZEPPELIN-3946] Fixed zeppelin hive interpreter broken 
pipe issue
---
 jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java 
b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
index d2ae404..000b46f 100644
--- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
+++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
@@ -409,7 +409,7 @@ public class JDBCInterpreter extends KerberosInterpreter {
     final String maxConnectionLifetime =
         
StringUtils.defaultIfEmpty(getProperty("zeppelin.jdbc.maxConnLifetime"), "-1");
     
poolableConnectionFactory.setMaxConnLifetimeMillis(Long.parseLong(maxConnectionLifetime));
-
+    poolableConnectionFactory.setValidationQuery("show databases");
     ObjectPool connectionPool = new 
GenericObjectPool(poolableConnectionFactory);
 
     poolableConnectionFactory.setPool(connectionPool);

Reply via email to