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 2019/08/02 19:02:21 UTC

[qpid-jms] branch master updated (ce06c6f -> 699f554)

This is an automated email from the ASF dual-hosted git repository.

tabish pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-jms.git.


    from ce06c6f  QPIDJMS-468: send disposition for delivered messages upon CLIENT_ACK session shutdown
     new a00b896  NO-JIRA tweak some tests to avoid race on peer start / setup
     new 699f554  QPIDJMS-469 Remove some unused variabels and code blocks

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/qpid/jms/JmsMessageConsumer.java    |  1 -
 .../qpid/jms/provider/amqp/AmqpFixedProducer.java  |  9 -----
 .../provider/failover/FailoverIntegrationTest.java | 41 ++++++++++++++--------
 3 files changed, 27 insertions(+), 24 deletions(-)


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


[qpid-jms] 02/02: QPIDJMS-469 Remove some unused variabels and code blocks

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-jms.git

commit 699f5549da1d47c7409f16d3e99f0dba2d225e32
Author: Timothy Bish <ta...@gmail.com>
AuthorDate: Fri Aug 2 14:58:22 2019 -0400

    QPIDJMS-469 Remove some unused variabels and code blocks
    
    Removes an unused atomic boolean in the consumer and a no longer used
    async result and set block that is no longer used by the producer
---
 .../src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java    | 1 -
 .../org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java     | 9 ---------
 2 files changed, 10 deletions(-)

diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
index a437f76..7cec9b5 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
@@ -69,7 +69,6 @@ public class JmsMessageConsumer implements AutoCloseable, MessageConsumer, JmsMe
     protected final MessageQueue messageQueue;
     protected final Lock lock = new ReentrantLock();
     protected final Lock dispatchLock = new ReentrantLock();
-    protected final AtomicBoolean suspendedConnection = new AtomicBoolean();
     protected final AtomicReference<Throwable> failureCause = new AtomicReference<>();
     protected final MessageDeliverTask deliveryTask = new MessageDeliverTask();
 
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
index d54f1f4..3c79fd7 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpFixedProducer.java
@@ -63,8 +63,6 @@ public class AmqpFixedProducer extends AmqpProducer {
     private final Map<Object, InFlightSend> sent = new LinkedHashMap<Object, InFlightSend>();
     private final Map<Object, InFlightSend> blocked = new LinkedHashMap<Object, InFlightSend>();
 
-    private AsyncResult sendCompletionWatcher;
-
     private final AmqpConnection connection;
 
     public AmqpFixedProducer(AmqpSession session, JmsProducerInfo info, Sender sender) {
@@ -404,13 +402,6 @@ public class AmqpFixedProducer extends AmqpProducer {
             // Put the message back to usable state following send complete
             envelope.getMessage().onSendComplete();
 
-            // Signal the watcher that all pending sends have completed if one is registered
-            // and both the in-flight sends and blocked sends have completed.
-            if (sendCompletionWatcher != null && sent.isEmpty() && blocked.isEmpty()) {
-                sendCompletionWatcher.onSuccess();
-                sendCompletionWatcher = null;
-            }
-
             // Once the pending sends queue is drained and all in-flight sends have been
             // settled we can propagate the close request.
             if (isAwaitingClose() && !isClosed() && blocked.isEmpty() && sent.isEmpty()) {


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


[qpid-jms] 01/02: NO-JIRA tweak some tests to avoid race on peer start / setup

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-jms.git

commit a00b896bfbcc3cb68ba3e407f96bf8db16d11276
Author: Timothy Bish <ta...@gmail.com>
AuthorDate: Fri Aug 2 14:56:08 2019 -0400

    NO-JIRA tweak some tests to avoid race on peer start / setup
---
 .../provider/failover/FailoverIntegrationTest.java | 41 ++++++++++++++--------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
index f79f16c..39a9a94 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
@@ -3619,13 +3619,13 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
 
     private void doCreateTemporaryDestinationFailsWhenLinkRefusedTestImpl(boolean topic, boolean deferAttachResponseWrite) throws Exception {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
-            JmsConnection connection = establishAnonymousConnecton(testPeer);
 
             testPeer.expectSaslAnonymous();
             testPeer.expectOpen();
             testPeer.expectBegin();
             testPeer.expectBegin();
 
+            JmsConnection connection = establishAnonymousConnecton(testPeer);
             connection.start();
 
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -3661,6 +3661,12 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
 
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
             final CountDownLatch producerClosed = new CountDownLatch(1);
+
+            testPeer.expectSaslAnonymous();
+            testPeer.expectOpen();
+            testPeer.expectBegin();
+            testPeer.expectBegin();
+
             JmsConnection connection = establishAnonymousConnecton(testPeer);
             connection.addConnectionListener(new JmsDefaultConnectionListener() {
                 @Override
@@ -3668,12 +3674,6 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
                     producerClosed.countDown();
                 }
             });
-
-            testPeer.expectSaslAnonymous();
-            testPeer.expectOpen();
-            testPeer.expectBegin();
-            testPeer.expectBegin();
-
             connection.start();
 
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -3723,15 +3723,19 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 20000)
     public void testPassthroughOfSendFailsWhenDelayedDeliveryIsNotSupported() throws Exception {
-        try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
-            // DO NOT add capability to indicate server support for DELAYED-DELIVERY
-            JmsConnection connection = establishAnonymousConnecton(testPeer);
+        try (TestAmqpPeer testPeer = new TestAmqpPeer()) {
+
+            final String testPeerURI = createPeerURI(testPeer);
+            LOG.info("Original peer is at: {}", testPeerURI);
 
             testPeer.expectSaslAnonymous();
             testPeer.expectOpen();
             testPeer.expectBegin();
             testPeer.expectBegin();
 
+            // DO NOT add capability to indicate server support for DELAYED-DELIVERY so that
+            // send fails and we can see if the error passes through the failover provider
+            JmsConnection connection = establishAnonymousConnecton(testPeer);
             connection.start();
 
             Matcher<Symbol[]> desiredCapabilitiesMatcher = arrayContaining(new Symbol[] { DELAYED_DELIVERY });
@@ -3765,14 +3769,17 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 20000)
     public void testPassthroughOfSendTimesOutWhenNoDispostionArrives() throws Exception {
-        try(TestAmqpPeer testPeer = new TestAmqpPeer();) {
-            JmsConnection connection = establishAnonymousConnecton(testPeer);
+        try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+
+            final String testPeerURI = createPeerURI(testPeer);
+            LOG.info("Original peer is at: {}", testPeerURI);
 
             testPeer.expectSaslAnonymous();
             testPeer.expectOpen();
             testPeer.expectBegin();
             testPeer.expectBegin();
 
+            JmsConnection connection = establishAnonymousConnecton(testPeer);
             connection.setSendTimeout(500);
             connection.start();
 
@@ -3810,7 +3817,9 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
     @Test(timeout=20000)
     public void testPassthroughOfRollbackErrorCoordinatorClosedOnCommit() throws Exception {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
-            JmsConnection connection = establishAnonymousConnecton(testPeer);
+
+            final String testPeerURI = createPeerURI(testPeer);
+            LOG.info("Original peer is at: {}", testPeerURI);
 
             testPeer.expectSaslAnonymous();
             testPeer.expectOpen();
@@ -3818,6 +3827,7 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
             testPeer.expectBegin();
             testPeer.expectCoordinatorAttach();
 
+            JmsConnection connection = establishAnonymousConnecton(testPeer);
             connection.start();
 
             Binary txnId1 = new Binary(new byte[]{ (byte) 5, (byte) 6, (byte) 7, (byte) 8});
@@ -3848,7 +3858,9 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
     @Test(timeout=20000)
     public void testPassthroughOfSessionCreateFailsOnDeclareTimeout() throws Exception {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
-            JmsConnection connection = establishAnonymousConnecton(testPeer);
+
+            final String testPeerURI = createPeerURI(testPeer);
+            LOG.info("Original peer is at: {}", testPeerURI);
 
             testPeer.expectSaslAnonymous();
             testPeer.expectOpen();
@@ -3859,6 +3871,7 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
             // Expect the AMQP session to be closed due to the JMS session creation failure.
             testPeer.expectEnd();
 
+            JmsConnection connection = establishAnonymousConnecton(testPeer);
             connection.setRequestTimeout(500);
             connection.start();
 


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