BUG/MINOR: spoe: Only skip sending new frame after a receive attempt

When a SPOE appctx is processing frames in sync mode, we must only skip
sending a new frame if it is still waiting for a ACK frame after a receive
attempt. It was performed before the receive attempt. As a consequence, if
the ACK frame was received, the SPOE appctx did not try to process queued
messages immediately. This could increase the queue time and thus slow down
the processing time of the stream.

Thanks to Daniel Epperson for his help to diagnose the bug.

This patch must be backported to every stable versions.
This commit is contained in:
Christopher Faulet 2023-06-05 08:15:59 +02:00
parent 64d0ed515b
commit bc9fb64623

View File

@ -1730,12 +1730,6 @@ spoe_handle_processing_appctx(struct appctx *appctx)
(agent->b.be->queue.length ||
(srv && (srv->queue.length || (srv->maxconn && srv->served >= srv_dynamic_maxconn(srv))))));
/* Don"t try to send new frame we are waiting for at lease a ack, in
* sync mode or if applet must be closed ASAP
*/
if (appctx->st0 == SPOE_APPCTX_ST_WAITING_SYNC_ACK || (close_asap && SPOE_APPCTX(appctx)->cur_fpa))
skip_sending = 1;
/* receiving_frame loop */
while (!skip_receiving) {
ret = spoe_handle_receiving_frame_appctx(appctx, &skip_receiving);
@ -1756,6 +1750,12 @@ spoe_handle_processing_appctx(struct appctx *appctx)
}
}
/* Don"t try to send new frame we are waiting for at lease a ack, in
* sync mode or if applet must be closed ASAP
*/
if (appctx->st0 == SPOE_APPCTX_ST_WAITING_SYNC_ACK || (close_asap && SPOE_APPCTX(appctx)->cur_fpa))
skip_sending = 1;
/* send_frame loop */
while (!skip_sending && SPOE_APPCTX(appctx)->cur_fpa < agent->max_fpa) {
ret = spoe_handle_sending_frame_appctx(appctx, &skip_sending);