You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2015/01/12 21:10:58 UTC

qpid-jms git commit: Improve some logging, use ThreadPoolUtils to shutdown the task runners

Repository: qpid-jms
Updated Branches:
  refs/heads/master 975e6c071 -> 46415a275


Improve some logging, use ThreadPoolUtils to shutdown the task runners

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/46415a27
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/46415a27
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/46415a27

Branch: refs/heads/master
Commit: 46415a2757212e7b3fe9788e6b415f1110131417
Parents: 975e6c0
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Jan 12 15:07:15 2015 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Jan 12 15:07:15 2015 -0500

----------------------------------------------------------------------
 .../jms/provider/failover/FailoverProvider.java | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/46415a27/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProvider.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProvider.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProvider.java
index 4fa7269..1e2f65a 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProvider.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/failover/FailoverProvider.java
@@ -49,6 +49,7 @@ import org.apache.qpid.jms.provider.ProviderFactory;
 import org.apache.qpid.jms.provider.ProviderFuture;
 import org.apache.qpid.jms.provider.ProviderListener;
 import org.apache.qpid.jms.util.IOExceptionSupport;
+import org.apache.qpid.jms.util.ThreadPoolUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -141,7 +142,7 @@ public class FailoverProvider extends DefaultProviderListener implements Provide
     @Override
     public void connect() throws IOException {
         checkClosed();
-        LOG.debug("Performing initial connection attempt");
+        LOG.debug("Initiating initial connection attempt task");
         triggerReconnectionAttempt();
     }
 
@@ -175,15 +176,8 @@ public class FailoverProvider extends DefaultProviderListener implements Provide
                     } catch (Exception e) {
                         LOG.debug("Caught exception while closing connection");
                     } finally {
-
-                        if (connectionHub != null) {
-                            connectionHub.shutdown();
-                        }
-
-                        if (serializer != null) {
-                            serializer.shutdown();
-                        }
-
+                        ThreadPoolUtils.shutdownGraceful(connectionHub);
+                        ThreadPoolUtils.shutdownGraceful(serializer);
                         request.onSuccess();
                     }
                 }
@@ -270,7 +264,7 @@ public class FailoverProvider extends DefaultProviderListener implements Provide
 
             @Override
             public boolean succeedsWhenOffline() {
-                // Allow this to succeed, acks would be stale.
+                // Allow this to succeed, resource won't get recreated on reconnect.
                 return true;
             }
         };
@@ -542,13 +536,13 @@ public class FailoverProvider extends DefaultProviderListener implements Provide
                 URI target = uris.getNext();
                 if (target != null) {
                     try {
-                        LOG.debug("Attempting connection to: {}", target);
+                        LOG.debug("Connection attempt:[{}] to: {} in-progress", reconnectAttempts, target);
                         JmsSslContext.setCurrentSslContext(sslContext);
                         Provider provider = ProviderFactory.create(target);
                         initializeNewConnection(provider);
                         return;
                     } catch (Throwable e) {
-                        LOG.info("Connection attempt to: {} failed.", target);
+                        LOG.info("Connection attempt:[{}] to: {} failed", reconnectAttempts, target);
                         failure = e;
                     }
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org