Ted Ross commented on PROTON-401:

I propose that proton consider the 'drained' state of the application to be 
level-sensitive and indicated by calls to 'drained' and 'offered'.  Whenever 
the application has at least one message to send, it will call pn_link_offered 
to indicate how many messages are ready to go.  Once the last message has been 
sent, the application calls 'drained' to indicate that there are no more 
messages for now (and until a subsequent call to offered).

Note that we could remove the pn_link_drained call altogether and replace it 
with an offered value of zero.

> 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.4
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>         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

Reply via email to