Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-646

TajoClient is blocked while main thread finished.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0, 0.9.0
    • Fix Version/s: 0.8.0
    • Component/s: RPC
    • Labels:
      None

      Description

      I tested Tajo JDBC Driver like bellow. After closing connection the TestCase still running.

      public static void main(String[] args) throws Exception {
      	Class.forName("org.apache.tajo.jdbc.TajoDriver").newInstance();
      	Connection conn = DriverManager
      			.getConnection("jdbc:tajo://127.0.0.1:26002");
      
      	Statement stmt = null;
      	ResultSet rs = null;
      	try {
      		stmt = conn.createStatement();
      		rs = stmt.executeQuery("select * from table1");
      		while (rs.next()) {
      			System.out.println(rs.getString(1) + "," + rs.getString(3));
      		}
      	} finally {
      		if (rs != null) rs.close();
      		if (stmt != null) stmt.close();
      		if (conn != null) conn.close();
      	}
      }
      
      1. TAJO-646_2.patch
        28 kB
        Jinho Kim
      2. TAJO-646.patch
        26 kB
        Hyoungjun Kim

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #99 (See https://builds.apache.org/job/Tajo-master-build/99/)
        TAJO-646: TajoClient is blocked while main thread finished. (hyoungjunkim via jinho) (jinossy: https://git-wip-us.apache.org/repos/asf/?p=incubator-tajo.git&a=commit&h=e47242e68e217f3d897ae897766f987a44657f7d)

        • tajo-rpc/src/main/java/org/apache/tajo/rpc/ServerCallable.java
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoPreparedStatement.java
        • tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSet.java
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoStatement.java
        • tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
        • tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java
        • CHANGES.txt
        • tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDriver.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #99 (See https://builds.apache.org/job/Tajo-master-build/99/ ) TAJO-646 : TajoClient is blocked while main thread finished. (hyoungjunkim via jinho) (jinossy: https://git-wip-us.apache.org/repos/asf/?p=incubator-tajo.git&a=commit&h=e47242e68e217f3d897ae897766f987a44657f7d ) tajo-rpc/src/main/java/org/apache/tajo/rpc/ServerCallable.java tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoPreparedStatement.java tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSet.java tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoStatement.java tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java CHANGES.txt tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDriver.java
        Hide
        jhkim Jinho Kim added a comment -

        Thank you for your contribution.
        I've just committed it to master and branch-0.8.0.

        Show
        jhkim Jinho Kim added a comment - Thank you for your contribution. I've just committed it to master and branch-0.8.0.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-0.8.0-build #7 (See https://builds.apache.org/job/Tajo-0.8.0-build/7/)
        TAJO-646: TajoClient is blocked while main thread finished. (hyoungjunkim via jinho) (jinossy: https://git-wip-us.apache.org/repos/asf/?p=incubator-tajo.git&a=commit&h=c2a59d78f318be8424ee69a1ba9ba295c91b3796)

        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDriver.java
        • tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSet.java
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoStatement.java
        • CHANGES.txt
        • tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoPreparedStatement.java
        • tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
        • tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
        • tajo-rpc/src/main/java/org/apache/tajo/rpc/ServerCallable.java
        • tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-0.8.0-build #7 (See https://builds.apache.org/job/Tajo-0.8.0-build/7/ ) TAJO-646 : TajoClient is blocked while main thread finished. (hyoungjunkim via jinho) (jinossy: https://git-wip-us.apache.org/repos/asf/?p=incubator-tajo.git&a=commit&h=c2a59d78f318be8424ee69a1ba9ba295c91b3796 ) tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoDriver.java tajo-client/src/main/java/org/apache/tajo/jdbc/TajoResultSet.java tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoStatement.java CHANGES.txt tajo-jdbc/src/main/java/org/apache/tajo/jdbc/TajoPreparedStatement.java tajo-rpc/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java tajo-rpc/src/main/java/org/apache/tajo/rpc/ServerCallable.java tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/AbstractCatalogClient.java
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12632497/TAJO-646_2.patch
        against master revision f4a9fd1.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 1 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to introduce 6 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-catalog/tajo-catalog-client tajo-client tajo-jdbc tajo-rpc.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/183//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/183//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-jdbc.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/183//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12632497/TAJO-646_2.patch against master revision f4a9fd1. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 1 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to introduce 6 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-catalog/tajo-catalog-client tajo-client tajo-jdbc tajo-rpc. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/183//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/183//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-jdbc.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/183//console This message is automatically generated.
        Hide
        jhkim Jinho Kim added a comment -

        I gave +1 on RB. I've tested on branch-0.8.0

        Show
        jhkim Jinho Kim added a comment - I gave +1 on RB. I've tested on branch-0.8.0
        Hide
        jhkim Jinho Kim added a comment -

        I've fixed some trivial findbugs

        Show
        jhkim Jinho Kim added a comment - I've fixed some trivial findbugs
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12632452/TAJO-646.patch
        against master revision f4a9fd1.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 1 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to introduce 8 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-catalog/tajo-catalog-client tajo-client tajo-jdbc tajo-rpc.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/180//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/180//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-jdbc.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/180//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12632452/TAJO-646.patch against master revision f4a9fd1. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 1 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to introduce 8 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-catalog/tajo-catalog-client tajo-client tajo-jdbc tajo-rpc. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/180//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/180//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-jdbc.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/180//console This message is automatically generated.
        Hide
        jhkim Jinho Kim added a comment -

        I've just updated the patch status

        Show
        jhkim Jinho Kim added a comment - I've just updated the patch status
        Hide
        hjkim Hyoungjun Kim added a comment -

        TajoClient has its own a ConnectionPool for thread safety. But in the previous implementation ServerCallable class calls RpcConnectionPool.getPool() which is shared. In this patch I changed that ServerCallable's constructor has ConnectionPool parameter.
        Please review this patch. Thanks

        Show
        hjkim Hyoungjun Kim added a comment - TajoClient has its own a ConnectionPool for thread safety. But in the previous implementation ServerCallable class calls RpcConnectionPool.getPool() which is shared. In this patch I changed that ServerCallable's constructor has ConnectionPool parameter. Please review this patch. Thanks
        Hide
        hjkim Hyoungjun Kim added a comment -

        Created a review request against branch master in reviewboard
        https://reviews.apache.org/r/18729/

        Show
        hjkim Hyoungjun Kim added a comment - Created a review request against branch master in reviewboard https://reviews.apache.org/r/18729/

          People

          • Assignee:
            hjkim Hyoungjun Kim
            Reporter:
            hjkim Hyoungjun Kim
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development