kgiusti commented on a change in pull request #492: DISPATCH-1310: refactor the
receive handler code
URL: https://github.com/apache/qpid-dispatch/pull/492#discussion_r278165794
##########
File path: src/container.c
##########
@@ -642,8 +641,8 @@ void qd_container_handle_event(qd_container_t *container,
pn_event_t *event,
delivery = pn_event_delivery(event);
pn_link = pn_event_link(event);
- if (pn_link_is_receiver(pn_link))
- do_receive(delivery);
+ if (pn_delivery_readable(delivery))
Review comment:
Turns out using pn_delivery_readable massively decreases the number calls to
do_receive() that do nothing (i.e. check if delivery is current and returns
since it isn't) in the case of single frame deliveries.
The way do_receive() works is that loops over all deliveries that have rx
complete starting with the links current delivery and advancing until it either
exhausts the links deliveries or it hits a delivery that does not have rx data.
This means that it processes all complete deliveries on receipt of the first
PN_DELIVERY event from proton.
That means all other complete rx has a "stale" PN_DELIVERY event on the
event queue, which leads to the useless calls to do_receive.
I'd like to keep this change unless as you mentioned there is some edge
condition it breaks that's not obvious from the code (and should be).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]