You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Gordon Sim (JIRA)" <qp...@incubator.apache.org> on 2010/01/04 20:55:54 UTC

[jira] Created: (QPID-2320) Failed acquire on LVQ causes broker crash

Failed acquire on LVQ causes broker crash
-----------------------------------------

                 Key: QPID-2320
                 URL: https://issues.apache.org/jira/browse/QPID-2320
             Project: Qpid
          Issue Type: Bug
          Components: C++ Broker
    Affects Versions: 0.6
            Reporter: Gordon Sim


If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


RE: [jira] Created: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by Robbie Gemmell <ro...@gmail.com>.
I see this has been marked resolved for 0.7, was it decided it isn't a blocker?

Robbie

> -----Original Message-----
> From: Carl Trieloff [mailto:cctrieloff@redhat.com]
> Sent: 04 January 2010 21:23
> To: dev@qpid.apache.org
> Subject: Re: [jira] Created: (QPID-2320) Failed acquire on LVQ causes
> broker crash
> 
> On 01/04/2010 02:55 PM, Gordon Sim (JIRA) wrote:
> > Failed acquire on LVQ causes broker crash
> > -----------------------------------------
> >
> >                   Key: QPID-2320
> >                   URL: https://issues.apache.org/jira/browse/QPID-
> 2320
> >               Project: Qpid
> >            Issue Type: Bug
> >            Components: C++ Broker
> >      Affects Versions: 0.6
> >              Reporter: Gordon Sim
> >
> >
> > If an acquire fails for an LVQ because the message has already been
> acquired by some other subscriber, the failed attempt causes the broker
> to crash. This is due to lack of proper bounds checking in
> Queue::acquire() for the LVQ case and was I believe introduced by
> http://svn.apache.org/viewvc?view=revision&revision=834172.
> >
> >
> >
> 
> 
> 
> This is a regression that causes a crash, should it be fixed for 0.6?
> 
> Carl.
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: [jira] Created: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by Carl Trieloff <cc...@redhat.com>.
On 01/04/2010 02:55 PM, Gordon Sim (JIRA) wrote:
> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                   Key: QPID-2320
>                   URL: https://issues.apache.org/jira/browse/QPID-2320
>               Project: Qpid
>            Issue Type: Bug
>            Components: C++ Broker
>      Affects Versions: 0.6
>              Reporter: Gordon Sim
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.
>
>
>    



This is a regression that causes a crash, should it be fixed for 0.6?

Carl.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796497#action_12796497 ] 

Carl Trieloff commented on QPID-2320:
-------------------------------------


Here is a diff which I think resolves it, take a look and I will commit if not comments.

Index: tests/QueueTest.cpp
===================================================================
--- tests/QueueTest.cpp	(revision 895748)
+++ tests/QueueTest.cpp	(working copy)
@@ -544,9 +544,14 @@
     framing::SequenceNumber sequence(1);
     QueuedMessage qmsg(queue.get(), msg1, sequence);
     QueuedMessage qmsg2(queue.get(), msg2, ++sequence);
+    framing::SequenceNumber sequence1(10);
+    QueuedMessage qmsg3(queue.get(), 0, sequence1);
 
     BOOST_CHECK(!queue->acquire(qmsg));
     BOOST_CHECK(queue->acquire(qmsg2));
+    // Acquire the massage again to test failure case.
+    BOOST_CHECK(!queue->acquire(qmsg2));
+    BOOST_CHECK(!queue->acquire(qmsg3));
 
     BOOST_CHECK_EQUAL(queue->getMessageCount(), 2u);
 
Index: qpid/broker/Queue.cpp
===================================================================
--- qpid/broker/Queue.cpp	(revision 895748)
+++ qpid/broker/Queue.cpp	(working copy)
@@ -263,9 +263,10 @@
     Mutex::ScopedLock locker(messageLock);
     QPID_LOG(debug, "attempting to acquire " << msg.position);
     Messages::iterator i = findAt(msg.position); 
-    if ((i != messages.end() && !lastValueQueue) // note that in some cases payload not be set
-        || (lastValueQueue && (i->position == msg.position) && 
-            msg.payload.get() == checkLvqReplace(*i).payload.get()) )  {
+    if ((i != messages.end() && msg.payload.get()) && // note that in some cases payload not be set
+        (!lastValueQueue ||
+        (lastValueQueue && (i->position == msg.position) && msg.payload.get() == checkLvqReplace(*i).payload.get()) )
+        )  {
 
         clearLVQIndex(msg);
         QPID_LOG(debug,
@@ -273,9 +274,7 @@
                  i->position << " == " << msg.position);
         messages.erase(i);
         return true;
-    } else {
-        QPID_LOG(debug, "No match: " << i->position << " != " << msg.position);
-    }
+    } 
     
     QPID_LOG(debug, "Acquire failed for " << msg.position);
     return false;


> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Andrew Stitcher (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796370#action_12796370 ] 

Andrew Stitcher commented on QPID-2320:
---------------------------------------

Soliciting opinion:

This seems like it might actually be a blocking bug -

1. It is a regression against 0.5 (lvq was introduced before 0.5 right?)
2. It is impossible to work around - or is not using LVQ considered a workaround?



> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796786#action_12796786 ] 

Gordon Sim commented on QPID-2320:
----------------------------------

As compared with the pre r834172 logic this removes a check for i->position == msg.position from the non-lvq case and adds in a test of msg.payload.get(). Is that deliberate?

I think it would be worth adding a comment on what the extra lvq related logic is doing and why. Its not an easy piece of code to follow.

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Updated: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim updated QPID-2320:
-----------------------------

    Priority: Blocker  (was: Major)

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>            Priority: Blocker
>             Fix For: 0.7
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Closed: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Andrew Stitcher (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Stitcher closed QPID-2320.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.6

Now been checked into 0.6 branch

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>            Assignee: Andrew Stitcher
>            Priority: Blocker
>             Fix For: 0.6, 0.7
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Resolved: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Carl Trieloff (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Trieloff resolved QPID-2320.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7

Committed revision 896687.


test and fix

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>             Fix For: 0.7
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804702#action_12804702 ] 

Gordon Sim commented on QPID-2320:
----------------------------------

Commit r896687 merged onto release branch for 0.6 as r902969.

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>            Priority: Blocker
>             Fix For: 0.7
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Assigned: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim reassigned QPID-2320:
--------------------------------

    Assignee: Andrew Stitcher

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>            Assignee: Andrew Stitcher
>            Priority: Blocker
>             Fix For: 0.7
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Reopened: (QPID-2320) Failed acquire on LVQ causes broker crash

Posted by "Gordon Sim (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim reopened QPID-2320:
------------------------------


reopening to fix as blocker in 0.6

> Failed acquire on LVQ causes broker crash
> -----------------------------------------
>
>                 Key: QPID-2320
>                 URL: https://issues.apache.org/jira/browse/QPID-2320
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.6
>            Reporter: Gordon Sim
>             Fix For: 0.7
>
>
> If an acquire fails for an LVQ because the message has already been acquired by some other subscriber, the failed attempt causes the broker to crash. This is due to lack of proper bounds checking in Queue::acquire() for the LVQ case and was I believe introduced by http://svn.apache.org/viewvc?view=revision&revision=834172.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org