[
https://issues.apache.org/jira/browse/QPID-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13779895#comment-13779895
]
Pavel Moravec commented on QPID-5183:
-------------------------------------
Comment to the patch to be committed:
Two code changes were required:
1) When receiving a message for a receiver that is closing or closed, release
them back. That is the change in do_message_transfer method.
2) The key one: when closing receiver (and sending message.cancel), check for
received messages for this receiver not fetched by the application yet - and
release them back as well. That is the change in do_unlink.
There are two gotchas, however:
a) code in do_unlink is quite inefficient (esp. repetitive calling
"rcv.session._pop(rcv)" that is inefficient for bigger session.incoming list
where first items of the list are checked every time; there should be a method
pop_messages_for_receiver in Session class that traverses "incoming" list just
once. Anyway there are usually just very few messages in the list at that time,
hence no need to improve the code
b) I still *think* the below interleaving of code execution could lead to the
same issue:
- thread1 starts do_message_transfer and passes "if rcv.closing or
rcv.closed:" test
- thread2 executes whole receiver closing, for that there is still no message
in session.incoming list
- thread1 continues in its method do_message_transfer and adds the message to
session.incoming
Now, the message sits in session.incoming forever and again is never released.
> Python client does not release acquired messages on consumer close when
> session persists
> ----------------------------------------------------------------------------------------
>
> Key: QPID-5183
> URL: https://issues.apache.org/jira/browse/QPID-5183
> Project: Qpid
> Issue Type: Bug
> Components: Python Client
> Affects Versions: 0.24
> Reporter: Pavel Moravec
> Assignee: Pavel Moravec
> Priority: Minor
>
> When closing a receiver on a session with multiple receivers open to the same
> destination, the receiver/session does not release acquired messages. Other
> consumers on the session then can't access the messages then.
> See https://bugzilla.redhat.com/show_bug.cgi?id=852067 for more details.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]