JBoss hornetq SVN: r10582 - trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-04-29 13:04:14 -0400 (Fri, 29 Apr 2011)
New Revision: 10582
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
Fixing deadlock caused by my previous fix - JBPAPP-6420
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 2011-04-29 17:04:02 UTC (rev 10581)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29 17:04:14 UTC (rev 10582)
@@ -17,6 +17,7 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -358,15 +359,12 @@
// inconsistencies
public void removeSession(final ClientSessionInternal session, boolean failingOver)
{
- synchronized (createSessionLock)
+ synchronized (sessions)
{
- synchronized (failoverLock)
- {
- sessions.remove(session);
- }
+ sessions.remove(session);
}
}
-
+
public void connectionReadyForWrites(final Object connectionID, final boolean ready)
{
}
@@ -413,8 +411,13 @@
{
synchronized (failoverLock)
{
+ HashSet<ClientSession> sessionsToClose;
+ synchronized (sessions)
+ {
+ sessionsToClose = new HashSet<ClientSession>(sessions);
+ }
// work on a copied set. the session will be removed from sessions when session.close() is called
- for (ClientSession session : new HashSet<ClientSession>(sessions))
+ for (ClientSession session : sessionsToClose)
{
try
{
@@ -581,7 +584,10 @@
if (connection == null)
{
- sessionsToClose = new HashSet<ClientSessionInternal>(sessions);
+ synchronized (sessions)
+ {
+ sessionsToClose = new HashSet<ClientSessionInternal>(sessions);
+ }
callFailureListeners(me, true, false);
}
}
@@ -729,7 +735,10 @@
sessionChannel,
orderedExecutorFactory.getExecutor());
- sessions.add(session);
+ synchronized (sessions)
+ {
+ sessions.add(session);
+ }
ChannelHandler handler = new ClientSessionPacketHandler(session, sessionChannel);
@@ -839,8 +848,14 @@
connection.setFailureListeners(newListeners);
- for (ClientSessionInternal session : sessions)
+ HashSet<ClientSessionInternal> sessionsToFailover;
+ synchronized (sessions)
{
+ sessionsToFailover = new HashSet<ClientSessionInternal>(sessions);
+ }
+
+ for (ClientSessionInternal session : sessionsToFailover)
+ {
session.handleFailover(connection);
}
}
13 years, 8 months
JBoss hornetq SVN: r10581 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-04-29 13:04:02 -0400 (Fri, 29 Apr 2011)
New Revision: 10581
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
Fixing deadlock caused by my previous fix - JBPAPP-6420
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29 16:19:47 UTC (rev 10580)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29 17:04:02 UTC (rev 10581)
@@ -17,6 +17,7 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -358,15 +359,12 @@
// inconsistencies
public void removeSession(final ClientSessionInternal session, boolean failingOver)
{
- synchronized (createSessionLock)
+ synchronized (sessions)
{
- synchronized (failoverLock)
- {
- sessions.remove(session);
- }
+ sessions.remove(session);
}
}
-
+
public void connectionReadyForWrites(final Object connectionID, final boolean ready)
{
}
@@ -413,8 +411,13 @@
{
synchronized (failoverLock)
{
+ HashSet<ClientSession> sessionsToClose;
+ synchronized (sessions)
+ {
+ sessionsToClose = new HashSet<ClientSession>(sessions);
+ }
// work on a copied set. the session will be removed from sessions when session.close() is called
- for (ClientSession session : new HashSet<ClientSession>(sessions))
+ for (ClientSession session : sessionsToClose)
{
try
{
@@ -581,7 +584,10 @@
if (connection == null)
{
- sessionsToClose = new HashSet<ClientSessionInternal>(sessions);
+ synchronized (sessions)
+ {
+ sessionsToClose = new HashSet<ClientSessionInternal>(sessions);
+ }
callFailureListeners(me, true, false);
}
}
@@ -729,7 +735,10 @@
sessionChannel,
orderedExecutorFactory.getExecutor());
- sessions.add(session);
+ synchronized (sessions)
+ {
+ sessions.add(session);
+ }
ChannelHandler handler = new ClientSessionPacketHandler(session, sessionChannel);
@@ -839,8 +848,14 @@
connection.setFailureListeners(newListeners);
- for (ClientSessionInternal session : sessions)
+ HashSet<ClientSessionInternal> sessionsToFailover;
+ synchronized (sessions)
{
+ sessionsToFailover = new HashSet<ClientSessionInternal>(sessions);
+ }
+
+ for (ClientSessionInternal session : sessionsToFailover)
+ {
session.handleFailover(connection);
}
}
13 years, 8 months
JBoss hornetq SVN: r10580 - in trunk: tests and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-04-29 12:19:47 -0400 (Fri, 29 Apr 2011)
New Revision: 10580
Modified:
trunk/pom.xml
trunk/tests/pom.xml
Log:
Fix issue with surefire-report.
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
+++ trunk/pom.xml 2011-04-29 16:19:47 UTC (rev 10580)
@@ -283,20 +283,20 @@
<artifactId>resteasy-atom-provider</artifactId>
<version>${resteasy.version}</version>
</dependency>
- <!-- needed to compile the tests-->
+ <!-- needed to compile the tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
</dependency>
- <!--needed to compile the jms tests-->
+ <!--needed to compile the jms tests -->
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-jaspi-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
- <!--needed to run the jms tests-->
+ <!--needed to run the jms tests -->
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
@@ -463,6 +463,11 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.8.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.3</version>
<configuration>
@@ -528,9 +533,9 @@
</executions>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-help-plugin</artifactId>
- <version>2.1.1</version>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-help-plugin</artifactId>
+ <version>2.1.1</version>
</plugin>
</plugins>
@@ -590,7 +595,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.8</version>
+ <version>2.8.1</version>
</plugin>
</plugins>
</reporting>
Modified: trunk/tests/pom.xml
===================================================================
--- trunk/tests/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
+++ trunk/tests/pom.xml 2011-04-29 16:19:47 UTC (rev 10580)
@@ -30,7 +30,6 @@
<configuration>
<skipTests>${skipUnitTests}</skipTests>
</configuration>
- <version>2.4</version>
</plugin>
</plugins>
</build>
13 years, 8 months
JBoss hornetq SVN: r10579 - in trunk: distribution/hornetq and 15 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-04-29 12:19:25 -0400 (Fri, 29 Apr 2011)
New Revision: 10579
Modified:
trunk/distribution/hornetq/pom.xml
trunk/distribution/jnp-client/pom.xml
trunk/distribution/pom.xml
trunk/examples/pom.xml
trunk/hornetq-bootstrap/pom.xml
trunk/hornetq-core-client/pom.xml
trunk/hornetq-core/pom.xml
trunk/hornetq-jboss-as-integration/pom.xml
trunk/hornetq-jms-client/pom.xml
trunk/hornetq-jms/pom.xml
trunk/hornetq-logging/pom.xml
trunk/hornetq-ra/hornetq-ra-jar/pom.xml
trunk/hornetq-ra/hornetq-ra-rar/pom.xml
trunk/hornetq-ra/pom.xml
trunk/hornetq-service-sar/pom.xml
trunk/hornetq-spring-integration/pom.xml
trunk/hornetq-twitter-integration/pom.xml
Log:
Remove spurious declaration of <groupId/>
Modified: trunk/distribution/hornetq/pom.xml
===================================================================
--- trunk/distribution/hornetq/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/distribution/hornetq/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -22,7 +22,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq</artifactId>
<packaging>pom</packaging>
<name>Actual HornetQ Distribution</name>
Modified: trunk/distribution/jnp-client/pom.xml
===================================================================
--- trunk/distribution/jnp-client/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/distribution/jnp-client/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -9,7 +9,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>jnp-client</artifactId>
<packaging>jar</packaging>
<name>JBoss jnp client jar</name>
Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/distribution/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-distribution</artifactId>
<packaging>pom</packaging>
<name>HornetQ Distribution</name>
Modified: trunk/examples/pom.xml
===================================================================
--- trunk/examples/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/examples/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-examples</artifactId>
<packaging>pom</packaging>
<name>HornetQ Examples</name>
Modified: trunk/hornetq-bootstrap/pom.xml
===================================================================
--- trunk/hornetq-bootstrap/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-bootstrap/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-bootstrap</artifactId>
<packaging>jar</packaging>
<version>2.2.3-SNAPSHOT</version>
Modified: trunk/hornetq-core/pom.xml
===================================================================
--- trunk/hornetq-core/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-core/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-core</artifactId>
<packaging>jar</packaging>
<name>HornetQ Core</name>
Modified: trunk/hornetq-core-client/pom.xml
===================================================================
--- trunk/hornetq-core-client/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-core-client/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -9,7 +9,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-core-client</artifactId>
<packaging>jar</packaging>
<name>HornetQ Core Client</name>
Modified: trunk/hornetq-jboss-as-integration/pom.xml
===================================================================
--- trunk/hornetq-jboss-as-integration/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-jboss-as-integration/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-jboss-as-integration</artifactId>
<packaging>jar</packaging>
<name>HornetQ JBoss AS Integration</name>
Modified: trunk/hornetq-jms/pom.xml
===================================================================
--- trunk/hornetq-jms/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-jms/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-jms</artifactId>
<packaging>jar</packaging>
<name>HornetQ JMS</name>
Modified: trunk/hornetq-jms-client/pom.xml
===================================================================
--- trunk/hornetq-jms-client/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-jms-client/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-jms-client</artifactId>
<packaging>jar</packaging>
<name>HornetQ JMS Client</name>
Modified: trunk/hornetq-logging/pom.xml
===================================================================
--- trunk/hornetq-logging/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-logging/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-logging</artifactId>
<packaging>jar</packaging>
<name>HornetQ Logging</name>
Modified: trunk/hornetq-ra/hornetq-ra-jar/pom.xml
===================================================================
--- trunk/hornetq-ra/hornetq-ra-jar/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-ra/hornetq-ra-jar/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-ra</artifactId>
<packaging>jar</packaging>
<name>HornetQ RAR JAR</name>
Modified: trunk/hornetq-ra/hornetq-ra-rar/pom.xml
===================================================================
--- trunk/hornetq-ra/hornetq-ra-rar/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-ra/hornetq-ra-rar/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-rar</artifactId>
<packaging>rar</packaging>
<name>HornetQ JMS RA</name>
Modified: trunk/hornetq-ra/pom.xml
===================================================================
--- trunk/hornetq-ra/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-ra/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-rar-pom</artifactId>
<packaging>pom</packaging>
Modified: trunk/hornetq-service-sar/pom.xml
===================================================================
--- trunk/hornetq-service-sar/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-service-sar/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-service-sar</artifactId>
<packaging>jar</packaging>
<name>HornetQ JBoss AS4 Integration</name>
Modified: trunk/hornetq-spring-integration/pom.xml
===================================================================
--- trunk/hornetq-spring-integration/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-spring-integration/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -21,7 +21,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-spring-integration</artifactId>
<packaging>jar</packaging>
<name>HornetQ Spring Integration</name>
Modified: trunk/hornetq-twitter-integration/pom.xml
===================================================================
--- trunk/hornetq-twitter-integration/pom.xml 2011-04-29 16:18:13 UTC (rev 10578)
+++ trunk/hornetq-twitter-integration/pom.xml 2011-04-29 16:19:25 UTC (rev 10579)
@@ -8,7 +8,6 @@
<version>2.2.3-SNAPSHOT</version>
</parent>
- <groupId>org.hornetq</groupId>
<artifactId>hornetq-twitter-integration</artifactId>
<packaging>jar</packaging>
<name>HornetQ Twitter Integration</name>
13 years, 8 months
JBoss hornetq SVN: r10578 - trunk.
by do-not-reply@jboss.org
Author: borges
Date: 2011-04-29 12:18:13 -0400 (Fri, 29 Apr 2011)
New Revision: 10578
Modified:
trunk/.gitignore
Log:
Git to ignore any folder called 'target'
Modified: trunk/.gitignore
===================================================================
--- trunk/.gitignore 2011-04-29 16:17:51 UTC (rev 10577)
+++ trunk/.gitignore 2011-04-29 16:18:13 UTC (rev 10578)
@@ -1,3 +1,4 @@
+target
# /
/build
13 years, 8 months
JBoss hornetq SVN: r10577 - trunk.
by do-not-reply@jboss.org
Author: borges
Date: 2011-04-29 12:17:51 -0400 (Fri, 29 Apr 2011)
New Revision: 10577
Modified:
trunk/pom.xml
Log:
Add the help plugin. Useful to debug maven.
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-04-29 13:43:08 UTC (rev 10576)
+++ trunk/pom.xml 2011-04-29 16:17:51 UTC (rev 10577)
@@ -527,6 +527,11 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-help-plugin</artifactId>
+ <version>2.1.1</version>
+ </plugin>
</plugins>
</build>
13 years, 8 months
JBoss hornetq SVN: r10576 - in trunk/hornetq-core/src/main/java/org/hornetq/core: transaction and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-04-29 09:43:08 -0400 (Fri, 29 Apr 2011)
New Revision: 10576
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/Topology.java
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java
trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java
Log:
Several fixes for testsuite = ClientSessionFActoryImpl = JBPAPP-6420, Topology = JBPAPP-6421, Transaction = JBPAPP-6422
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 2011-04-29 13:42:38 UTC (rev 10575)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29 13:43:08 UTC (rev 10576)
@@ -358,20 +358,13 @@
// inconsistencies
public void removeSession(final ClientSessionInternal session, boolean failingOver)
{
- if (!failingOver)
+ synchronized (createSessionLock)
{
- synchronized (createSessionLock)
+ synchronized (failoverLock)
{
- synchronized (failoverLock)
- {
- sessions.remove(session);
- }
+ sessions.remove(session);
}
}
- else
- {
- sessions.remove(session);
- }
}
public void connectionReadyForWrites(final Object connectionID, final boolean ready)
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java 2011-04-29 13:42:38 UTC (rev 10575)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/Topology.java 2011-04-29 13:43:08 UTC (rev 10576)
@@ -103,7 +103,11 @@
public void sendTopology(ClusterTopologyListener listener)
{
int count = 0;
- Map<String, TopologyMember> copy = new HashMap<String, TopologyMember>(topology);
+ Map<String, TopologyMember> copy;
+ synchronized (this)
+ {
+ copy = new HashMap<String, TopologyMember>(topology);
+ }
for (Map.Entry<String, TopologyMember> entry : copy.entrySet())
{
listener.nodeUP(entry.getKey(), entry.getValue().getConnector(), ++count == copy.size());
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java 2011-04-29 13:42:38 UTC (rev 10575)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/Transaction.java 2011-04-29 13:43:08 UTC (rev 10576)
@@ -59,8 +59,6 @@
void addOperation(TransactionOperation sync);
- void removeOperation(TransactionOperation sync);
-
public List<TransactionOperation> getAllOperations();
boolean hasTimedOut(long currentTime, int defaultTimeout);
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-04-29 13:42:38 UTC (rev 10575)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-04-29 13:43:08 UTC (rev 10576)
@@ -436,20 +436,14 @@
operations.add(operation);
}
- public void removeOperation(final TransactionOperation operation)
- {
- checkCreateOperations();
-
- operations.remove(operation);
- }
-
public int getOperationsCount()
{
return operations.size();
}
- public List<TransactionOperation> getAllOperations() {
- return operations;
+ public synchronized List<TransactionOperation> getAllOperations()
+ {
+ return new ArrayList<TransactionOperation>(operations);
}
public void putProperty(final int index, final Object property)
@@ -495,7 +489,7 @@
return new TransactionImpl(this);
}
- public void afterCommit()
+ public synchronized void afterCommit()
{
if (operations != null)
{
13 years, 8 months
JBoss hornetq SVN: r10575 - in branches/Branch_2_2_EAP/src/main/org/hornetq/core: transaction and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-04-29 09:42:38 -0400 (Fri, 29 Apr 2011)
New Revision: 10575
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
Log:
Several fixes for testsuite = ClientSessionFActoryImpl = JBPAPP-6420, Topology = JBPAPP-6421, Transaction = JBPAPP-6422
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-04-29 13:42:38 UTC (rev 10575)
@@ -358,20 +358,13 @@
// inconsistencies
public void removeSession(final ClientSessionInternal session, boolean failingOver)
{
- if (!failingOver)
+ synchronized (createSessionLock)
{
- synchronized (createSessionLock)
+ synchronized (failoverLock)
{
- synchronized (failoverLock)
- {
- sessions.remove(session);
- }
+ sessions.remove(session);
}
}
- else
- {
- sessions.remove(session);
- }
}
public void connectionReadyForWrites(final Object connectionID, final boolean ready)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java 2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java 2011-04-29 13:42:38 UTC (rev 10575)
@@ -103,7 +103,11 @@
public void sendTopology(ClusterTopologyListener listener)
{
int count = 0;
- Map<String, TopologyMember> copy = new HashMap<String, TopologyMember>(topology);
+ Map<String, TopologyMember> copy;
+ synchronized (this)
+ {
+ copy = new HashMap<String, TopologyMember>(topology);
+ }
for (Map.Entry<String, TopologyMember> entry : copy.entrySet())
{
listener.nodeUP(entry.getKey(), entry.getValue().getConnector(), ++count == copy.size());
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java 2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/Transaction.java 2011-04-29 13:42:38 UTC (rev 10575)
@@ -59,8 +59,6 @@
void addOperation(TransactionOperation sync);
- void removeOperation(TransactionOperation sync);
-
public List<TransactionOperation> getAllOperations();
boolean hasTimedOut(long currentTime, int defaultTimeout);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-04-28 23:03:27 UTC (rev 10574)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2011-04-29 13:42:38 UTC (rev 10575)
@@ -436,20 +436,14 @@
operations.add(operation);
}
- public void removeOperation(final TransactionOperation operation)
- {
- checkCreateOperations();
-
- operations.remove(operation);
- }
-
public int getOperationsCount()
{
return operations.size();
}
- public List<TransactionOperation> getAllOperations() {
- return operations;
+ public synchronized List<TransactionOperation> getAllOperations()
+ {
+ return new ArrayList<TransactionOperation>(operations);
}
public void putProperty(final int index, final Object property)
@@ -495,7 +489,7 @@
return new TransactionImpl(this);
}
- public void afterCommit()
+ public synchronized void afterCommit()
{
if (operations != null)
{
13 years, 8 months
JBoss hornetq SVN: r10574 - in trunk/tests/integration-tests/src/test/java/org/hornetq/tests: util and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-04-28 19:03:27 -0400 (Thu, 28 Apr 2011)
New Revision: 10574
Added:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSClusteredTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java
Log:
There's no such thing as enough tests.. just wrote a test and decided to commit it
Added: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java (rev 0)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java 2011-04-28 23:03:27 UTC (rev 10574)
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.jms.client;
+
+import javax.jms.Connection;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+
+import org.hornetq.api.jms.management.TopicControl;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.tests.integration.management.ManagementControlHelper;
+import org.hornetq.tests.util.JMSTestBase;
+
+/**
+ *
+ * A MessageTest
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class ExpiryMessageTest extends JMSTestBase
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ @Override
+ protected Configuration createDefaultConfig(boolean netty)
+ {
+ Configuration conf = super.createDefaultConfig(netty);
+
+ conf.setMessageExpiryScanPeriod(1000);
+
+ return conf;
+ }
+
+ public void testSendTopicNoSubscription() throws Exception
+ {
+
+ Topic topic = createTopic("test-topic");
+ TopicControl control = ManagementControlHelper.createTopicControl(topic, mbeanServer);
+
+ System.out.println("size = " + control.getMessageCount());
+
+ Connection conn2 = cf.createConnection();
+
+ conn2.setClientID("client1");
+
+ Session sess2 = conn2.createSession(true, Session.SESSION_TRANSACTED);
+
+ sess2.createDurableSubscriber(topic, "client-sub1");
+ sess2.createDurableSubscriber(topic, "client-sub2");
+
+ conn2.close();
+
+ Connection conn = cf.createConnection();
+ Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
+ MessageProducer prod = sess.createProducer(topic);
+ prod.setTimeToLive(1000);
+
+ for (int i = 0 ; i < 100; i++)
+ {
+ TextMessage txt = sess.createTextMessage("txt");
+ prod.send(txt);
+ }
+
+ sess.commit();
+
+ conn.close();
+
+ // minimal time needed
+ Thread.sleep(2000);
+
+ long timeout = System.currentTimeMillis() + 10000;
+
+ // We will wait some time, but we will wait as minimal as possible
+ while (control.getMessageCount() != 0 && System.currentTimeMillis() > timeout)
+ {
+ Thread.sleep(100);
+ }
+
+ assertEquals(0, control.getMessageCount());
+
+
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+ // Inner classes -------------------------------------------------
+}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSClusteredTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSClusteredTestBase.java 2011-04-28 23:02:24 UTC (rev 10573)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSClusteredTestBase.java 2011-04-28 23:03:27 UTC (rev 10574)
@@ -151,7 +151,7 @@
"server2",
1000,
true,
- true,
+ false,
MAX_HOPS,
1024,
toOtherServerPair, false));
@@ -196,7 +196,7 @@
"server1",
1000,
true,
- true,
+ false,
MAX_HOPS,
1024,
toOtherServerPair, false));
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java 2011-04-28 23:02:24 UTC (rev 10573)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/util/JMSTestBase.java 2011-04-28 23:03:27 UTC (rev 10574)
@@ -19,6 +19,8 @@
import javax.jms.ConnectionFactory;
import javax.jms.Queue;
import javax.jms.Topic;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
import javax.naming.NamingException;
import org.hornetq.api.core.TransportConfiguration;
@@ -45,6 +47,8 @@
protected HornetQServer server;
protected JMSServerManagerImpl jmsServer;
+
+ protected MBeanServer mbeanServer;
protected ConnectionFactory cf;
@@ -101,15 +105,15 @@
protected void setUp() throws Exception
{
super.setUp();
+
+ mbeanServer = MBeanServerFactory.createMBeanServer();
Configuration conf = createDefaultConfig(false);
- conf.setSecurityEnabled(false);
- conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
conf.getConnectorConfigurations().put("netty", new TransportConfiguration(NettyConnectorFactory.class.getName()));
- server = HornetQServers.newHornetQServer(conf, usePersistence());
+ server = HornetQServers.newHornetQServer(conf, mbeanServer, usePersistence());
jmsServer = new JMSServerManagerImpl(server);
context = new InVMContext();
@@ -118,6 +122,17 @@
registerConnectionFactory();
}
+
+ @Override
+ protected Configuration createDefaultConfig(boolean netty)
+ {
+ Configuration conf = super.createDefaultConfig(netty);
+
+ conf.setSecurityEnabled(false);
+ conf.setJMXManagementEnabled(true);
+
+ return conf;
+ }
protected void restartServer() throws Exception
{
@@ -149,7 +164,14 @@
context = null;
+ MBeanServerFactory.releaseMBeanServer(mbeanServer);
+
+ mbeanServer = null;
+
super.tearDown();
+
+
+ super.tearDown();
}
// Private -------------------------------------------------------
13 years, 8 months
JBoss hornetq SVN: r10573 - in branches/Branch_2_2_EAP/tests/src/org/hornetq/tests: util and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-04-28 19:02:24 -0400 (Thu, 28 Apr 2011)
New Revision: 10573
Added:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSTestBase.java
Log:
There is no such thing as enough tests. Created a test to verify a possible issue and committed it
Added: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java (rev 0)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/client/ExpiryMessageTest.java 2011-04-28 23:02:24 UTC (rev 10573)
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.jms.client;
+
+import javax.jms.Connection;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+
+import org.hornetq.api.jms.management.TopicControl;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.tests.integration.management.ManagementControlHelper;
+import org.hornetq.tests.util.JMSTestBase;
+
+/**
+ *
+ * A MessageTest
+ *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class ExpiryMessageTest extends JMSTestBase
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ @Override
+ protected Configuration createDefaultConfig(boolean netty)
+ {
+ Configuration conf = super.createDefaultConfig(netty);
+
+ conf.setMessageExpiryScanPeriod(1000);
+
+ return conf;
+ }
+
+ public void testSendTopicNoSubscription() throws Exception
+ {
+
+ Topic topic = createTopic("test-topic");
+ TopicControl control = ManagementControlHelper.createTopicControl(topic, mbeanServer);
+
+ System.out.println("size = " + control.getMessageCount());
+
+ Connection conn2 = cf.createConnection();
+
+ conn2.setClientID("client1");
+
+ Session sess2 = conn2.createSession(true, Session.SESSION_TRANSACTED);
+
+ sess2.createDurableSubscriber(topic, "client-sub1");
+ sess2.createDurableSubscriber(topic, "client-sub2");
+
+ conn2.close();
+
+ Connection conn = cf.createConnection();
+ Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
+ MessageProducer prod = sess.createProducer(topic);
+ prod.setTimeToLive(1000);
+
+ for (int i = 0 ; i < 100; i++)
+ {
+ TextMessage txt = sess.createTextMessage("txt");
+ prod.send(txt);
+ }
+
+ sess.commit();
+
+ conn.close();
+
+ // minimal time needed
+ Thread.sleep(2000);
+
+ long timeout = System.currentTimeMillis() + 10000;
+
+ // We will wait some time, but we will wait as minimal as possible
+ while (control.getMessageCount() != 0 && System.currentTimeMillis() > timeout)
+ {
+ Thread.sleep(100);
+ }
+
+ assertEquals(0, control.getMessageCount());
+
+
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+ // Inner classes -------------------------------------------------
+}
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java 2011-04-28 15:53:00 UTC (rev 10572)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSClusteredTestBase.java 2011-04-28 23:02:24 UTC (rev 10573)
@@ -151,7 +151,7 @@
"server2",
1000,
true,
- true,
+ false,
MAX_HOPS,
1024,
toOtherServerPair, false));
@@ -196,7 +196,7 @@
"server1",
1000,
true,
- true,
+ false,
MAX_HOPS,
1024,
toOtherServerPair, false));
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSTestBase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSTestBase.java 2011-04-28 15:53:00 UTC (rev 10572)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/JMSTestBase.java 2011-04-28 23:02:24 UTC (rev 10573)
@@ -19,6 +19,8 @@
import javax.jms.ConnectionFactory;
import javax.jms.Queue;
import javax.jms.Topic;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
import javax.naming.NamingException;
import org.hornetq.api.core.TransportConfiguration;
@@ -45,6 +47,8 @@
protected HornetQServer server;
protected JMSServerManagerImpl jmsServer;
+
+ protected MBeanServer mbeanServer;
protected ConnectionFactory cf;
@@ -101,15 +105,15 @@
protected void setUp() throws Exception
{
super.setUp();
+
+ mbeanServer = MBeanServerFactory.createMBeanServer();
Configuration conf = createDefaultConfig(false);
- conf.setSecurityEnabled(false);
- conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(NettyAcceptorFactory.class.getName()));
conf.getConnectorConfigurations().put("netty", new TransportConfiguration(NettyConnectorFactory.class.getName()));
- server = HornetQServers.newHornetQServer(conf, usePersistence());
+ server = HornetQServers.newHornetQServer(conf, mbeanServer, usePersistence());
jmsServer = new JMSServerManagerImpl(server);
context = new InVMContext();
@@ -118,6 +122,17 @@
registerConnectionFactory();
}
+
+ @Override
+ protected Configuration createDefaultConfig(boolean netty)
+ {
+ Configuration conf = super.createDefaultConfig(netty);
+
+ conf.setSecurityEnabled(false);
+ conf.setJMXManagementEnabled(true);
+
+ return conf;
+ }
protected void restartServer() throws Exception
{
@@ -149,7 +164,14 @@
context = null;
+ MBeanServerFactory.releaseMBeanServer(mbeanServer);
+
+ mbeanServer = null;
+
super.tearDown();
+
+
+ super.tearDown();
}
// Private -------------------------------------------------------
13 years, 8 months