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

[python] example broker never removes empty queues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • proton-c-0.29.0
    • proton-c-0.30.0
    • python-binding
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: