qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Commented] (PROTON-2091) [python] example broker never removes empty queues
Date Sat, 24 Aug 2019 07:48:00 GMT

    [ https://issues.apache.org/jira/browse/PROTON-2091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16914855#comment-16914855
] 

ASF GitHub Bot commented on PROTON-2091:
----------------------------------------

jdanekrh commented on pull request #188: PROTON-2091: fix `len(queue)` in python/examples
and reformat for PEP8
URL: https://github.com/apache/qpid-proton/pull/188
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> [python] example broker never removes empty queues
> --------------------------------------------------
>
>                 Key: PROTON-2091
>                 URL: https://issues.apache.org/jira/browse/PROTON-2091
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>    Affects Versions: proton-c-0.29.0
>            Reporter: Jiri Daněk
>            Assignee: Jiri Daněk
>            Priority: Trivial
>
> {code:python:title=python/examples/broker.py}
>     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)
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message