Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20C8BDBC1 for ; Wed, 5 Sep 2012 14:28:08 +0000 (UTC) Received: (qmail 71046 invoked by uid 500); 5 Sep 2012 14:28:07 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 70963 invoked by uid 500); 5 Sep 2012 14:28:07 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 70954 invoked by uid 99); 5 Sep 2012 14:28:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 14:28:07 +0000 Date: Thu, 6 Sep 2012 01:28:07 +1100 (NCT) From: "Gabriel Gerhardsson (JIRA)" To: dev@activemq.apache.org Message-ID: <1248522264.39113.1346855287861.JavaMail.jiratomcat@arcas> In-Reply-To: <1016744372.38524.1346848747685.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (AMQ-4022) SEND directly after SUBSCRIBE causes bad state -> no DISCONNECT receipt MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMQ-4022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gabriel Gerhardsson updated AMQ-4022: ------------------------------------- Description: Executive summary --- A message is lost, the connection ends up in a strange state, and then when the client sends DISCONNECT it gets no receipt. Details --- Steps to reproduce: 1) Using STOMP 2) Send a SUBSCRIBE message with destination=/topic/foo, without asking for a receipt. No other options sent in message. 3) Send a message to /topic/foo, without asking for a receipt. 4) Wait 10ms for message 5) Go right ahead and send DISCONNECT message, asking for a receipt. 5.1) About 20% of the time, no DISCONNECT receipt is received, however long the client waits. This seems to coincide with the case when the message doesn't arrive in #4. 5.2) It does look like ActiveMQ gets the DISCONNECT message tho since it unsubscribes the client from /topic/foo at that timestamp. The DISCONNECT receipt getting lost is clearly a bug. Waiting for the receipt is important since I've seen cases where the client isn't unregistered properly in ActiveMQ if the client just sends DISCONNECT and then closes the socket. Test script --- Apply the small patch to the perl library Net/Stomp.pm It's a naive minimal patch to make it wait for a receipt for the DISCONNECT message. It will actually just wait for any frame to arrive and won't check what it is, but it's enough for this test. Run amqtest.pl a few times. A non-buggy run completes almost immediately. A buggy run hangs the script during disconnect. Workaround --- When sending the SUBSCRIBE with receipt requested, and waiting for the receipt before sending the SEND, I was unable to reproduce the issue, even after running the script 100000 times. was: Executive summary --- A message is lost, the connection ends up in a strange state, and then when the client sends DISCONNECT it gets no receipt. Details --- Steps to reproduce: 1) Using STOMP 2) Send a SUBSCRIBE message with destination=/topic/foo, without asking for a receipt. No other options sent in message. 3) Send a message to /topic/foo, without asking for a receipt. 4) Wait 10ms for message 5) Go right ahead and send DISCONNECT message, asking for a receipt. 5.1) About 20% of the time, no DISCONNECT receipt is received, however long the client waits. This seems to coincide with the case when the message doesn't arrive in #4. 5.2) It does look like ActiveMQ gets the DISCONNECT message tho since it unsubscribes the client from /topic/foo at that timestamp. The DISCONNECT receipt getting lost is clearly a bug. Waiting for the receipt is important since I've seen cases where the client isn't unregistered properly in ActiveMQ if the client just sends DISCONNECT and then closes the socket. Test script --- Apply the small patch to the perl library Net/Stomp.pm It's a naive minimal patch to make it wait for a receipt for the DISCONNECT message. It will actually just wait for any frame to arrive and won't check what it is, but it's enough for this test. Run amqtest.pl a few times. A non-buggy run completes almost immediately. A buggy run hangs the script during disconnect. > SEND directly after SUBSCRIBE causes bad state -> no DISCONNECT receipt > ----------------------------------------------------------------------- > > Key: AMQ-4022 > URL: https://issues.apache.org/jira/browse/AMQ-4022 > Project: ActiveMQ > Issue Type: Bug > Components: stomp > Affects Versions: 5.5.1 > Environment: SLES11-SP1 x86_64 > Reporter: Gabriel Gerhardsson > Attachments: amqtest.pl, Net_Stomp.pm.diff > > > Executive summary > --- > A message is lost, the connection ends up in a strange state, and then when the client sends DISCONNECT it gets no receipt. > Details > --- > Steps to reproduce: > 1) Using STOMP > 2) Send a SUBSCRIBE message with destination=/topic/foo, without asking for a receipt. No other options sent in message. > 3) Send a message to /topic/foo, without asking for a receipt. > 4) Wait 10ms for message > 5) Go right ahead and send DISCONNECT message, asking for a receipt. > 5.1) About 20% of the time, no DISCONNECT receipt is received, however long the client waits. This seems to coincide with the case when the message doesn't arrive in #4. > 5.2) It does look like ActiveMQ gets the DISCONNECT message tho since it unsubscribes the client from /topic/foo at that timestamp. > The DISCONNECT receipt getting lost is clearly a bug. Waiting for the receipt is important since I've seen cases where the client isn't unregistered properly in ActiveMQ if the client just sends DISCONNECT and then closes the socket. > Test script > --- > Apply the small patch to the perl library Net/Stomp.pm > It's a naive minimal patch to make it wait for a receipt for the DISCONNECT message. It will actually just wait for any frame to arrive and won't check what it is, but it's enough for this test. > Run amqtest.pl a few times. A non-buggy run completes almost immediately. A buggy run hangs the script during disconnect. > Workaround > --- > When sending the SUBSCRIBE with receipt requested, and waiting for the receipt before sending the SEND, I was unable to reproduce the issue, even after running the script 100000 times. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira