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

[email protected] commented on QPID-3629:
-----------------------------------------------------



bq.  On 2011-11-22 14:34:00, Kenneth Giusti wrote:
bq.  > /trunk/qpid/cpp/src/qpid/broker/Credit.cpp, line 38
bq.  > <https://reviews.apache.org/r/2880/diff/2-3/?file=59378#file59378line38>
bq.  >
bq.  >     Just for consideration - would it make sense to check for 
balance+value wrap, and pin balance to INFINITE_CREDIT-1 rather than use the 
wrapped value?
bq.  
bq.  Gordon Sim wrote:
bq.      Not sure I follow you, could you elaborate a little?

I'm probably not understanding the credit granting constraints - but I' 
wondering if it's more correct to wrap the balance -or- pin the balance.  e.g.:

if (value == INFINITE_CREDIT)
  balance = INFINITE_CREDIT
else if (value + balance < balance) // wrap
  balance = INFINITE_CREDIT - 1
else balance += value

I'm ok with the proposed solution, I'm just uncomfortable when absolute 
quantities wrap in general.... :)


- Kenneth


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/2880/#review3430
-----------------------------------------------------------


On 2011-11-22 14:55:19, Gordon Sim wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/2880/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-11-22 14:55:19)
bq.  
bq.  
bq.  Review request for Alan Conway, Kenneth Giusti, Robbie Gemmell, rajith 
attapattu, and Keith Wall.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  The c++ broker does not track the actual credit window as distinct from 
the remaining credit. This means that when a message-stop is received followed 
by a message-flow, the total number of outstanding, uncompleted messages for 
the subscription is larger than the window. Fixing the corner cases requires 
tracking some extra state in window mode. This patch modifies thing s to track 
the window size and the current used credit in that case. (In explicit mode we 
just track the available credit as before). I've moved all the credit logic out 
into its own pair of files and attempted to reduce a lot of the repetitiveness 
(once the changes needed to address the issue in the JIRA, the code was even 
messier than before).
bq.  
bq.  The extra state also needs to be communicated to cluster updatees, so 
there is a small modification to the update process and one of the update 
commands.
bq.  
bq.  
bq.  This addresses bug QPID-3629.
bq.      https://issues.apache.org/jira/browse/QPID-3629
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    /trunk/qpid/cpp/src/qpid/broker/SemanticState.h 1203231 
bq.    /trunk/qpid/cpp/src/CMakeLists.txt 1203231 
bq.    /trunk/qpid/cpp/src/Makefile.am 1203231 
bq.    /trunk/qpid/cpp/src/qpid/broker/Credit.h PRE-CREATION 
bq.    /trunk/qpid/cpp/src/qpid/broker/Credit.cpp PRE-CREATION 
bq.    /trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp 1203231 
bq.    /trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp 1203231 
bq.    /trunk/qpid/cpp/src/qpid/cluster/Connection.h 1203231 
bq.    /trunk/qpid/cpp/src/qpid/cluster/Connection.cpp 1203231 
bq.    /trunk/qpid/cpp/src/qpid/cluster/UpdateClient.cpp 1203231 
bq.    /trunk/qpid/cpp/src/tests/ClientSessionTest.cpp 1203231 
bq.    /trunk/qpid/cpp/xml/cluster.xml 1203231 
bq.    /trunk/qpid/python/qpid/testlib.py 1203231 
bq.    /trunk/qpid/tests/src/py/qpid_tests/broker_0_10/message.py 1203231 
bq.  
bq.  Diff: https://reviews.apache.org/r/2880/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  New test from Keith included in the patch. All existing tests pass.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Gordon
bq.  
bq.


                
> CPP Broker allows credit window to exceed the request size.
> -----------------------------------------------------------
>
>                 Key: QPID-3629
>                 URL: https://issues.apache.org/jira/browse/QPID-3629
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.14
>            Reporter: Keith Wall
>            Assignee: Gordon Sim
>         Attachments: 
> 0001-QPID-3629-demonstrate-credit-window-issue-using-pyth.patch
>
>
> Investigation of QPID-2703 revealed that the CPP Broker can be made to extend 
> the window size beyond that requested by the client's message.flow command.   
> To reproduce the problem, the client must perform the following steps:
> 1) Receive messages
> 2) Perform message stop
> 3) Perform message flow
> 4) Complete messages received by step 1)
> 5) Observe the window is the sum of that requested by step 3 + the recredit 
> of messages from 1)
> The window handling behaviour of the CPP Broker was the reason that QPID-2703 
> was not apparent against the CPP Broker but was against the Java Broker which 
> does not expand the window in this way.
> The attached Python test demonstrates the issue by receiving more uncompleted 
> message commands than the window should allow.  Obviously it can be argued 
> that the python test does not have the expected order of commands, but there 
> is nothing stopping a client from performing such a sequence (e.g. the Qpid 
> Java Client) so the broker should enforce the requested window size 
> regardless.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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:[email protected]

Reply via email to