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

Rafael H. Schloming commented on PROTON-200:
--------------------------------------------

I agree it's a release blocker to fix it in some form. There are actually a 
number of areas of work involved in fixing this long-term. As mentioned above 
there are two scenarios:

1) The messenger has handed out all of its credit and gets a new link. This is 
in some ways easier to address as it simply requires re-balancing the credit, 
but in order to do that the engine needs some updates to allow revoking of 
credit. This is permitted by the protocol, but not currently fully supported by 
the engine. I'm currently working on a patch for engine support.

2) The messenger has more links than it has credit to hand out. Once again 
we're missing a little bit of engine support to fix this properly. The protocol 
allows a peer with available messages to advertise that fact to its partner 
(i.e. request credit) via the available field in the flow control frame, and 
the partner can then use this information to allocate credit. There is already 
a JIRA for the engine portion of this work (PROTON-39).

Beyond (1) and (2), another more straightforward measure we can take is to 
provide an unlimited mode, e.g. in the bindings make the argument to 
pn_messenger_recv optional, and for C define pn_messenger_recv(-1) to mean "no 
specific limit". This would allow the internals to dynamically determine how 
much credit to hand out and would make dealing with these problems relatively 
simple, although it wouldn't allow the application to limit its exposure to 
incoming messages. My guess is this is the quickest/most complete 
fix/workaround for 0.4.

So to summarize I'd say there are probably n separate chunks of work here each 
worthy of there own JIRA:

1) allow pn_messenger_recv(-1) to mean no specific limit
2) engine support for revoking of credit
3) engine support for advertising available messages (PROTON-39)
4) messenger support for re-allocating credit (removing from one peer and 
giving to another)
                
> [Proton-c] Credit distribution by messenger is not balanced across all links
> ----------------------------------------------------------------------------
>
>                 Key: PROTON-200
>                 URL: https://issues.apache.org/jira/browse/PROTON-200
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.3
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>             Fix For: 0.4
>
>         Attachments: proton-200.patch
>
>
> The method used to distribute credit to receiving links may lead to 
> starvation when the number of receiving links is > the available credit.
> The distribution algorithm always starts with the same link - see 
> messenger.c::pn_messenger_flow()

--
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

Reply via email to