You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by "jbertram (via GitHub)" <gi...@apache.org> on 2023/11/13 18:05:06 UTC

[PR] ARTEMIS-4501 clean up MQTT subscription queues when session expires [activemq-artemis]

jbertram opened a new pull request, #4673:
URL: https://github.com/apache/activemq-artemis/pull/4673

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ARTEMIS-4501 clean up MQTT subscription queues when session expires [activemq-artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #4673:
URL: https://github.com/apache/activemq-artemis/pull/4673#discussion_r1406480880


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java:
##########
@@ -970,11 +970,17 @@ public void testCleanStartFalseWithNon0SessionExpiryInterval() throws Exception
       consumer.subscribe(TOPIC, 2);
       consumer.disconnect();
 
+      // ensure the subscription queue still exists since the session hasn't expired
+      assertNotNull(getSubscriptionQueue(TOPIC, CONSUMER_ID));
+
       // session should *not* still exist since session expiry interval has passed
       long start = System.currentTimeMillis();
       Wait.assertEquals(0, () -> getSessionStates().size(), EXPIRY_INTERVAL * 1000 * 2, 100);
       assertTrue(System.currentTimeMillis() - start > (EXPIRY_INTERVAL * 1000));
       assertNull(getSessionStates().get(CONSUMER_ID));
+
+      // ensure the subscription queue is cleaned up when the session expires
+      assertNull(getSubscriptionQueue(TOPIC, CONSUMER_ID));

Review Comment:
   Looking...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ARTEMIS-4501 clean up MQTT subscription queues when session expires [activemq-artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic commented on code in PR #4673:
URL: https://github.com/apache/activemq-artemis/pull/4673#discussion_r1406471606


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java:
##########
@@ -970,11 +970,17 @@ public void testCleanStartFalseWithNon0SessionExpiryInterval() throws Exception
       consumer.subscribe(TOPIC, 2);
       consumer.disconnect();
 
+      // ensure the subscription queue still exists since the session hasn't expired
+      assertNotNull(getSubscriptionQueue(TOPIC, CONSUMER_ID));
+
       // session should *not* still exist since session expiry interval has passed
       long start = System.currentTimeMillis();
       Wait.assertEquals(0, () -> getSessionStates().size(), EXPIRY_INTERVAL * 1000 * 2, 100);
       assertTrue(System.currentTimeMillis() - start > (EXPIRY_INTERVAL * 1000));
       assertNull(getSessionStates().get(CONSUMER_ID));
+
+      // ensure the subscription queue is cleaned up when the session expires
+      assertNull(getSubscriptionQueue(TOPIC, CONSUMER_ID));

Review Comment:
   I just ran this test with repetion until failure, and it failed at the assertTrue on line 979



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ARTEMIS-4501 clean up MQTT subscription queues when session expires [activemq-artemis]

Posted by "jbertram (via GitHub)" <gi...@apache.org>.
jbertram commented on code in PR #4673:
URL: https://github.com/apache/activemq-artemis/pull/4673#discussion_r1406502833


##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt5/spec/controlpackets/ConnectTests.java:
##########
@@ -970,11 +970,17 @@ public void testCleanStartFalseWithNon0SessionExpiryInterval() throws Exception
       consumer.subscribe(TOPIC, 2);
       consumer.disconnect();
 
+      // ensure the subscription queue still exists since the session hasn't expired
+      assertNotNull(getSubscriptionQueue(TOPIC, CONSUMER_ID));
+
       // session should *not* still exist since session expiry interval has passed
       long start = System.currentTimeMillis();
       Wait.assertEquals(0, () -> getSessionStates().size(), EXPIRY_INTERVAL * 1000 * 2, 100);
       assertTrue(System.currentTimeMillis() - start > (EXPIRY_INTERVAL * 1000));
       assertNull(getSessionStates().get(CONSUMER_ID));
+
+      // ensure the subscription queue is cleaned up when the session expires
+      assertNull(getSubscriptionQueue(TOPIC, CONSUMER_ID));

Review Comment:
   I pushed a fix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ARTEMIS-4501 clean up MQTT subscription queues when session expires [activemq-artemis]

Posted by "clebertsuconic (via GitHub)" <gi...@apache.org>.
clebertsuconic merged PR #4673:
URL: https://github.com/apache/activemq-artemis/pull/4673


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org