You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/04/18 13:51:22 UTC

[1/2] activemq-artemis git commit: ARTEMIS-1806 JDBC Connection leaks

Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x 502b31705 -> 9b534f8ce


ARTEMIS-1806 JDBC Connection leaks

(cherry picked from commit bbb2f708dd86d681a02237aa1b7c366668af37d4)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9a42280d
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9a42280d
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9a42280d

Branch: refs/heads/1.x
Commit: 9a42280dce81a64bf8592c31601a4b74bf9bcd5e
Parents: 502b317
Author: Francesco Nigro <ni...@gmail.com>
Authored: Sat Apr 14 10:37:34 2018 +0200
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Apr 18 09:51:16 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/jdbc/store/file/JDBCFileUtils.java      | 8 ++++++--
 .../core/server/impl/SharedStoreBackupActivation.java        | 7 +++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a42280d/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
index 5834852..803584b 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
@@ -44,8 +44,12 @@ class JDBCFileUtils {
    }
 
    static JDBCSequentialFileFactoryDriver getDBFileDriver(DataSource dataSource, SQLProvider provider) throws SQLException {
-      JDBCSequentialFileFactoryDriver dbDriver;
-      if (POSTGRESQL.equals(PropertySQLProvider.Factory.investigateDialect(dataSource.getConnection()))) {
+      final JDBCSequentialFileFactoryDriver dbDriver;
+      final PropertySQLProvider.Factory.SQLDialect sqlDialect;
+      try (Connection connection = dataSource.getConnection()) {
+         sqlDialect = PropertySQLProvider.Factory.investigateDialect(connection);
+      }
+      if (POSTGRESQL.equals(sqlDialect)) {
          dbDriver = new PostgresSequentialSequentialFileDriver(dataSource, provider);
       } else {
          dbDriver = new JDBCSequentialFileFactoryDriver(dataSource, provider);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9a42280d/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
index a955f70..c93c726 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreBackupActivation.java
@@ -215,8 +215,11 @@ public final class SharedStoreBackupActivation extends Activation {
 
                            // ensure that the server to which we are failing back actually starts fully before we restart
                            nodeManager.start();
-                           nodeManager.awaitLiveStatus();
-                           nodeManager.stop();
+                           try {
+                              nodeManager.awaitLiveStatus();
+                           } finally {
+                              nodeManager.stop();
+                           }
 
                            synchronized (failbackCheckerGuard) {
                               if (cancelFailBackChecker || !sharedStoreSlavePolicy.isRestartBackup())


[2/2] activemq-artemis git commit: This closes #2029

Posted by cl...@apache.org.
This closes #2029


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9b534f8c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9b534f8c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9b534f8c

Branch: refs/heads/1.x
Commit: 9b534f8ce2d102354c4a5cebc639ecdd0f33ac34
Parents: 502b317 9a42280
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Apr 18 09:51:17 2018 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Apr 18 09:51:17 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/jdbc/store/file/JDBCFileUtils.java      | 8 ++++++--
 .../core/server/impl/SharedStoreBackupActivation.java        | 7 +++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------