Bug 919017 - XML exchange does not update statistics when no binding key matches routing key
Summary: XML exchange does not update statistics when no binding key matches routing key
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 2.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 3.0
: ---
Assignee: Ernie
QA Contact: Leonid Zhaldybin
URL:
Whiteboard:
Depends On:
Blocks: 785156
TreeView+ depends on / blocked
 
Reported: 2013-03-07 12:18 UTC by Pavel Moravec
Modified: 2018-12-06 14:58 UTC (History)
6 users (show)

Fixed In Version: qpid-cpp-0.22-2
Doc Type: Bug Fix
Doc Text:
It was discovered that doRoute(msg, b) was not called when the routing key of a message did not match the binding key of an XML exchange. This caused the QMF statistics msgIn, msgDrop, byteIn and byteDrop to incorrectly update. The fix calls doRoute(...) even if the routing key and binding key do not match. The QMF statistics now update as expected.
Clone Of:
Environment:
Last Closed: 2014-09-24 15:07:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
reproducer (1.32 KB, text/x-python)
2013-03-07 12:19 UTC, Pavel Moravec
no flags Details
Simple patch proposal (1.17 KB, patch)
2013-03-11 14:32 UTC, Pavel Moravec
no flags Details | Diff
Slightly modified patch to compile on current trunk (1.14 KB, patch)
2013-03-18 14:41 UTC, Ernie
no flags Details | Diff
Tar file containing test program source and test execution script. (974 bytes, application/x-gzip)
2013-07-31 20:12 UTC, Irina Boverman
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-4658 0 None None None Never
Red Hat Product Errata RHEA-2014:1296 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.0 Release 2014-09-24 19:00:06 UTC

Description Pavel Moravec 2013-03-07 12:18:00 UTC
Description of problem:
If no binding key for a XML exchange matches the routing key of incoming message, then QMF statistics of the exchange are not updated - while msgIn, msgDrop, byteIn and byteDrop should be updated.


Version-Release number of selected component (if applicable):
0.18-14


How reproducible:
100%


Steps to Reproduce:
(using attached script - see    ssn.sender("myxml/weather_wrong; ..    differs from   rxaddr += 'key: weather, '   and thus the message is to be dropped)
service qpidd restart
python xml_exchange_test.py
qpid-stat -e | egrep '(xchang|=|myxml)'

  
Actual results:
Exchanges
  exchange            type     dur  bind  msgIn  msgOut  msgDrop  byteIn  byteOut  byteDrop
  ===========================================================================================
  myxml               xml              1     0      0       0        0       0        0


Expected results:
Exchanges
  exchange            type     dur  bind  msgIn  msgOut  msgDrop  byteIn  byteOut  byteDrop
  ===========================================================================================
  myxml               xml              1     1      0       1      172       0      172


Additional info:
This BZ assumes XML exchange runs xquery only for the bindings with binding key matching routing key of the message being processed - something I dont see a reason for, as the xquery should decide alone if the binding matches or not.

Comment 1 Pavel Moravec 2013-03-07 12:19:15 UTC
Created attachment 706551 [details]
reproducer

Slightly modified example from https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_MRG/2/html-single/Messaging_Programming_Reference/index.html#sect-XML_Exchange - just routing key in sent message is different.

Comment 2 Pavel Moravec 2013-03-11 14:32:42 UTC
Created attachment 708424 [details]
Simple patch proposal

If bindingsMap[routingKey].snapshot() is null, dont return XmlExchange::route() immediatelly but let call doRoute(msg, b); for empty BindingList b - it will just count the stats.

Not sure if RWlock::ScopedRlock l(lock); makes further sense now, though.

Comment 4 Ernie 2013-03-18 14:41:03 UTC
Created attachment 712007 [details]
Slightly modified patch to compile on current trunk

Was reviewed and approved.

Comment 5 Justin Ross 2013-03-18 19:23:29 UTC
-> POST

http://svn.apache.org/viewvc?view=revision&revision=1457924

Comment 7 Irina Boverman 2013-07-31 20:12:27 UTC
Created attachment 781348 [details]
Tar file containing test program source and test execution script.

Comment 11 errata-xmlrpc 2014-09-24 15:07:03 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1296.html


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