You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Gordon Sim (JIRA)" <ji...@apache.org> on 2011/04/28 14:37:07 UTC

[jira] [Issue Comment Edited] (QPID-3232) fetch(timeout=0) does not behave as expected on receiver with capacity=1

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

Gordon Sim edited comment on QPID-3232 at 4/28/11 12:36 PM:
------------------------------------------------------------

Suggested fix:

{noformat}
Index: qpid/messaging/endpoints.py
===================================================================
--- qpid/messaging/endpoints.py	(revision 1096729)
+++ qpid/messaging/endpoints.py	(working copy)
@@ -1007,9 +1007,9 @@
       self.draining = True
       self._wakeup()
       self._ecwait(lambda: not self.draining)
+      msg = self.session._get(self, timeout=0)
       self._grant()
       self._wakeup()
-      msg = self.session._get(self, timeout=0)
       if msg is None:
         raise Empty()
     elif self._capacity not in (0, UNLIMITED.value):
{noformat}

I.e. move the _grant() call (and associated wakeup()) after the _get() call on the session that updates the returned count.


      was (Author: gsim):
    Suggested fix:

Index: qpid/messaging/endpoints.py
===================================================================
--- qpid/messaging/endpoints.py	(revision 1096729)
+++ qpid/messaging/endpoints.py	(working copy)
@@ -1007,9 +1007,9 @@
       self.draining = True
       self._wakeup()
       self._ecwait(lambda: not self.draining)
+      msg = self.session._get(self, timeout=0)
       self._grant()
       self._wakeup()
-      msg = self.session._get(self, timeout=0)
       if msg is None:
         raise Empty()
     elif self._capacity not in (0, UNLIMITED.value):


I.e. move the _grant() call (and associated wakeup()) after the _get() call on the session that updates the returned count.

  
> fetch(timeout=0) does not behave as expected on receiver with capacity=1
> ------------------------------------------------------------------------
>
>                 Key: QPID-3232
>                 URL: https://issues.apache.org/jira/browse/QPID-3232
>             Project: Qpid
>          Issue Type: Bug
>          Components: Python Client
>    Affects Versions: 0.10
>            Reporter: Gordon Sim
>             Fix For: 0.11
>
>
> Fill a queue up with some messages (some > 1). Create a receiver with capacity=1. Call fetch() in a loop with timeout=0. 
> Expect to get all the messages that were on the queue to start with. Only get the first message.
> It appears to be a result of the client not restoring its credit correctly after the first flush.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org