Bug 621468 - rejected messages are not dequeued
rejected messages are not dequeued
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
beta
All Linux
high Severity high
: 1.3.0.1
: ---
Assigned To: Jonathan Robie
Martin Kudlej
:
Depends On:
Blocks: 652092
  Show dependency treegraph
 
Reported: 2010-08-05 03:13 EDT by Gordon Sim
Modified: 2013-08-05 20:54 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A flaw in the message broker caused rejected messages to remain on the queue. If a durable message was rejected and the broker was restarted, the message would stay in the queue since it was not removed from the durable store. As a result, the rejected message was erroneously redelivered. With this update, the aforementioned defect has been fixed and rejected messages are now properly dequeued.
Story Points: ---
Clone Of:
: 652092 (view as bug list)
Environment:
Last Closed: 2010-11-30 12:50:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gordon Sim 2010-08-05 03:13:25 EDT
Description of problem:

Rejected messages are dropped, but not dequeued. For durable messages this means they will 're-appear' after a restart. For non-durable messages it means that the queue message count is incorrect.
Comment 1 Jonathan Robie 2010-09-28 08:49:30 EDT
Fixed upstream in commit 1002147.

Adding a test to the store module on qpidcomponents.org.
Comment 2 Gordon Sim 2010-11-03 07:31:29 EDT
The test mentioned in the previous comment was committed to https://svn.jboss.org/repos/rhmessaging/store/trunk/cpp as r4354.
Comment 4 Jeff Needle 2010-11-03 07:46:40 EDT
Test added is here:

svn diff -r4353:4354 http://anonsvn.jboss.org/repos/rhmessaging/store/trunk/cpp
Comment 5 Jonathan Robie 2010-11-05 17:01:31 EDT
Cherry-picked into:

mrg_1.3.x
fa6eab57a32883969ebdd78fa589846068375de7
Comment 6 Ted Ross 2010-11-09 20:55:21 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: A defect in the message broker causes rejected messages to remain on the queue.

Consequence: If a durable message is rejected, and the broker is restarted.  The message will have remained on the queue since it was not removed from the durable store.  In this case, the rejected message is erroneously redelivered.

Fix: The broker defect has been fixed.

Result: Rejected messages are now properly dequeued.
Comment 8 Martin Kudlej 2010-11-11 09:01:31 EST
Reproduced on version 1.3 on RHEL5.
Tested on RHEL5/4 x i386/x86_64 with
python-qpid-0.7.946106-14
qpid-cpp-client-0.7.946106-19
qpid-cpp-client-devel-0.7.946106-19
qpid-cpp-client-devel-docs-0.7.946106-19
qpid-cpp-client-ssl-0.7.946106-19
qpid-cpp-server-0.7.946106-19
qpid-cpp-server-devel-0.7.946106-19
qpid-cpp-server-ssl-0.7.946106-19
qpid-cpp-server-store-0.7.946106-19
qpid-cpp-server-xml-0.7.946106-19
qpid-java-client-0.7.946106-12
qpid-java-common-0.7.946106-12
qpid-java-example-0.7.946106-12
qpid-tools-0.7.946106-11
qmf-devel-0.7.946106-19
python-qmf-0.7.946106-14
qmf-0.7.946106-19

and it works -->VERIFIED

reproducer:
import sys
import os
from qpid.messaging import *
import qmf.console
import time

if len(sys.argv)<2:
  broker =  "localhost:5672"
else:
  broker = sys.argv[1]

if len(sys.argv)<3:
  address = "amq.topic"
else:
  address = sys.argv[2]

connection = Connection(broker)

try:
  connection.open()
  session = connection.session()

  snd = session.sender("tmr; {create:always, node:{type:queue, durable:True}}")
  rcv = session.receiver("tmr; {create:always, node:{type:queue, durable:True}}")
  m1 = Message("test_message_reject", durable=True, correlation_id="Msg00010")
  snd.send(m1)
  m2 = rcv.fetch()
  session.acknowledge(message=m2, disposition=Disposition(REJECTED))
  connection.close()

  os.system("service qpidd restart")
  time.sleep(20)

  session2 = qmf.console.Session()
  broker = session2.addBroker()
  agent = None;
  for i_agent in session2.getAgents():
    if i_agent.getAgentBank() == '0':
      agent = i_agent;
  queue_list = session2.getObjects(_class="queue", _agent=agent)
  for queue in queue_list:
    if queue.name == "tmr":
      print "queue depth:", queue.msgDepth
      assert queue.msgDepth == 0

  session2.delBroker(broker)

except MessagingError,m:
  print m
Comment 10 errata-xmlrpc 2010-11-30 12:50:50 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0921.html
Comment 11 Martin Prpič 2010-12-01 09:49:42 EST
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1 @@
-Cause: A defect in the message broker causes rejected messages to remain on the queue.
+A flaw in the message broker caused rejected messages to remain on the queue. If a durable message was rejected and the broker was restarted, the message would stay in the queue since it was not removed from the durable store. As a result, the rejected message was erroneously redelivered. With this update, the aforementioned defect has been fixed and rejected messages are now properly dequeued.-
-Consequence: If a durable message is rejected, and the broker is restarted.  The message will have remained on the queue since it was not removed from the durable store.  In this case, the rejected message is erroneously redelivered.
-
-Fix: The broker defect has been fixed.
-
-Result: Rejected messages are now properly dequeued.

Note You need to log in before you can comment on or make changes to this bug.