Qpid
  1. Qpid
  2. QPID-4720

C++ Broker Headers exchange match comparison self tests use stale comparison code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20
    • Fix Version/s: 0.23
    • Component/s: C++ Broker
    • Labels:
      None

      Description

      Steps to Reproduce:
      1. Use the old Python client API and do this:

      session.exchange_bind(exchange="MyHeadersExchange", queue="MyQueue", arguments=

      {"x-match":"all", "MyHeader":1}

      )

      2. Use the new C++ messaging API to send a message like this:

      Message msg(;
      msg.getProperties()["MyHeader"] = boost::uint16_t(1);

      3. Use qpid-stat to see if the exchange routed the message to the queue, or if it was dropped. In this case, it will be incorrectly dropped.

      Actual results: Message is dropped

      Expected results: Message is delivered into queue MyQueue

      Additional info: It looks like the binding generated via Python is a match on the value 1L. If we create a C++ client to set up the binding, it creates a match based on 1. It looks like the headers exchange thinks that 1 (2-bytes) isn't the same as 1L (4-bytes).
      ----------

      Headers exchange looks at the value type and sees that they are different and so does not compare the value data.

      I'm comfortable saying that the comparison is based on the header entry's type and data value. If the types don't match then the comparison fails. This is how the code works now.

      To match "comparable" data types then the match must cover [int uint]_[8 16 32 64], and possibly float and double. Even a string data type could be matched "1", "0x1", and so on. This could be an awful lot of development effort and testing.

      What is the correct behavior?

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        24d 1h 4m 1 Chuck Rolke 29/Apr/13 21:23
        Resolved Resolved Closed Closed
        131d 17h 13m 1 Justin Ross 08/Sep/13 14:37
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Justin Ross added a comment -
        Show
        Justin Ross added a comment - Released in Qpid 0.24, http://qpid.apache.org/releases/qpid-0.24/index.html
        Chuck Rolke made changes -
        Summary C++ Broker Headers exchange match comparison issue with value types C++ Broker Headers exchange match comparison self tests use stale comparison code
        Chuck Rolke made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 0.23 [ 12324273 ]
        Resolution Fixed [ 1 ]
        Hide
        Chuck Rolke added a comment -

        Fixed at Committed revision 1477317.

        Bug with comparing float types tracked in QPID-4740.

        Show
        Chuck Rolke added a comment - Fixed at Committed revision 1477317. Bug with comparing float types tracked in QPID-4740 .
        Hide
        Chuck Rolke added a comment -

        The correct behavior is to match values when they are compatible.

        Research into moving Headers exchange match to use the Selector comparison logic reveals that Headers exchange is already using logic that is correct. When the code was refactored in August, 2012, the mission code moved to a new Matcher logic that solves the original complaint but the self tests still use the old logic.

        With only minor changes a new match function could be developed. This version of match is then called by mission code and by self tests. The old version of match and its supporting code is to be deleted.

        Show
        Chuck Rolke added a comment - The correct behavior is to match values when they are compatible. Research into moving Headers exchange match to use the Selector comparison logic reveals that Headers exchange is already using logic that is correct. When the code was refactored in August, 2012, the mission code moved to a new Matcher logic that solves the original complaint but the self tests still use the old logic. With only minor changes a new match function could be developed. This version of match is then called by mission code and by self tests. The old version of match and its supporting code is to be deleted.
        Chuck Rolke made changes -
        Field Original Value New Value
        Assignee Chuck Rolke [ chug ]
        Chuck Rolke created issue -

          People

          • Assignee:
            Chuck Rolke
            Reporter:
            Chuck Rolke
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development