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

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

I can see how the level set scenario Ted describes could work. My concern, 
however, is that it would force a possibly undesirable amount of coupling 
between sources of messages and their consumption point. In the particular case 
of the queue scenario it seems like the head and the tail of the queue would be 
forced to be synchronized. In the more general case, it's just hard to know 
whether it would always be possible to call pn_link_offered in time.

Another option that might be worth considering is adding the notion of 
"interesting conditions" at the link level along with a query API at the 
connection level to allow an application efficiently navigate to the set of 
interesting links. I believe we have considered doing this in the past and 
deferred it because we found ways to work around the need for it, but it 
strikes me as a generally useful mechanism that might improve both this and 
other scenarios. I'm thinking an application could configure the link to say 
"I'm interested in knowing when you have positive credit", or "I'm interested 
in knowing when you get a drain request". I would think with this kind of 
mechanism the application could call drained when it is needed by the current 
semantics, and do it in an efficient way. I think this would also allow some 
other very useful patterns, e.g. allowing an application to efficiently divert 
messages to whatever links have available credit.

> Ordering issue prevents credit drain from working properly
> ----------------------------------------------------------
>
>                 Key: PROTON-401
>                 URL: https://issues.apache.org/jira/browse/PROTON-401
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.5
>            Reporter: Ken Giusti
>            Assignee: Rafael H. Schloming
>             Fix For: 0.6
>
>         Attachments: drain-error.patch, drain-hack.patch
>
>
> If the sending link calls pn_link_drained() to indicate that it has send all 
> pending data, and afterwards it receives a Flow frame with drain=true from 
> the peer, then the drain never completes.
> The ordering is the problem: if the flow frame w/drain=true is received 
> _BEFORE_ the sender calls pn_link_drained(), then it works.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to