[hornetq-commits] JBoss hornetq SVN: r12193 - trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Feb 24 11:04:58 EST 2012
Author: borges
Date: 2012-02-24 11:04:57 -0500 (Fri, 24 Feb 2012)
New Revision: 12193
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
Stop trying to failover or reconnect if exitLoop==true.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2012-02-24 16:04:38 UTC (rev 12192)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2012-02-24 16:04:57 UTC (rev 12193)
@@ -436,9 +436,9 @@
public void causeExit()
{
+ exitLoop = true;
synchronized (waitLock)
{
- exitLoop = true;
waitLock.notifyAll();
}
}
@@ -450,6 +450,7 @@
return;
}
+ exitLoop = true;
synchronized (exitLock)
{
exitLock.notifyAll();
@@ -635,7 +636,7 @@
synchronized (exitLock)
{
- while (inCreateSession)
+ while (inCreateSession && !exitLoop)
{
try
{
@@ -657,13 +658,17 @@
connection = null;
- try
+ Connector localConnector = connector;
+ if (localConnector != null)
{
- connector.close();
+ try
+ {
+ localConnector.close();
+ }
+ catch (Exception ignore)
+ {
+ }
}
- catch (Exception ignore)
- {
- }
cancelScheduledTasks();
@@ -792,6 +797,9 @@
connection.destroy();
}
+ if (exitLoop)
+ throw e;
+
if (e.getCode() == HornetQException.UNBLOCKED)
{
// This means the thread was blocked on create session and failover unblocked it
@@ -894,7 +902,9 @@
}
// Should never get here
- throw new IllegalStateException("Internal Error! ClientSessionFactoryImpl::createSessionInternal " + "just reached a condition that was not supposed to happen. "
+ throw new HornetQException(HornetQException.INTERNAL_ERROR,
+ "Internal Error! ClientSessionFactoryImpl::createSessionInternal "
+ + "just reached a condition that was not supposed to happen. "
+ "Please inform this condition to the HornetQ team");
}
@@ -974,6 +984,8 @@
private void getConnectionWithRetry(final int reconnectAttempts)
{
+ if (exitLoop)
+ return;
if (ClientSessionFactoryImpl.log.isTraceEnabled())
{
ClientSessionFactoryImpl.log.trace("getConnectionWithRetry::" + reconnectAttempts +
@@ -1117,6 +1129,8 @@
{
if (closed)
throw new IllegalStateException("ClientSessionFactory is closed!");
+ if (exitLoop)
+ return null;
synchronized (connectionLock)
{
if (connection == null)
More information about the hornetq-commits
mailing list