Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2091

[python] example broker never removes empty queues

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: proton-c-0.29.0
    • Fix Version/s: proton-c-0.30.0
    • Component/s: python-binding
    • Labels:
      None
    • Flags:
      Patch

      Description

          def unsubscribe(self, consumer):
               if consumer in self.consumers:
                  self.consumers.remove(consumer)
               return len(self.consumers) == 0 and (self.dynamic or self.queue.count == 0)
      

      Here, self.queue.count == 0 can never be True (because method reference != integer). This means that broker will never drop the Queue object.

      Functionality wise, the impact of this is insignificant, given the uses of the code (stand-in for real broker when running simple messaging examples).

      It has compatibility implications, however, because self.queue.count is a Python 2.7 addition and on Python 2.6 accessing undefined property will raise exception and crash the broker.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jdanek Jiri Daněk
                Reporter:
                jdanek Jiri Daněk
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: