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

Keith Wall commented on QPID-7387:
----------------------------------

The attached Broker patch prevents the {{Pre0_10CreditManager#_messageCredit}} 
falling below zero.   With this patch if the Broker receives a QOS, and the QOS 
messageCreditLimit is lower than the number of prefetched messages already held 
by the client, the Broker considers the channel to be out of credit and no more 
messages will be sent until the client acknowledges (or rejects) some messages.

However, the current behaviour of the legacy Qpid JMS client means there remain 
some scenarios where a consumer will starve.  If the application causes the 
prefetch window to be increased by calling {{#receive}} beyond the initially 
configured prefetch setting,  the application will receive the additional 
messages successfully.  When the application performs a  #commit, the client 
will internally send QOS reverting the prefetch buffer back to its original 
size.  If at that point the number of prefetch messages exceeds the original 
prefetch limit, the channel will have no more available credit.  If the client 
continues to call #receive without acknowledging the ones it has already, it 
won't request more credit (as {{currentPrefetch < getPrefetch()}}) and will 
eventually starve.



> [0-8..0-91] Mishandling of message credit allows consumers to starve
> --------------------------------------------------------------------
>
>                 Key: QPID-7387
>                 URL: https://issues.apache.org/jira/browse/QPID-7387
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: 0.32, qpid-java-6.0, qpid-java-6.1
>            Reporter: Keith Wall
>         Attachments: WIP_Prevent0-9CreditManagerGoingNegative.patch, 
> WIP_Python0-91PrefetchTest.patch
>
>
> The {{Pre0_10CreditManager}} mishandles message credit. In some circumstances 
> allows message credit to fall beneath 0.  Once this has occurred, messages 
> cease to flow to all consumers associated with the session (messages appear 
> stuck on the queue).  Recreating the session (or connection) will allow 
> messages to flow again.
> This problem was reproduced on a 0.32 derivative but it appears the same 
> issue will affect newer releases too.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to