diff --git a/src/flt_spoe.c b/src/flt_spoe.c index b82071007..a7d6bb950 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2096,11 +2096,15 @@ spoe_queue_context(struct spoe_context *ctx) return -1; } - /* Add the SPOE context in the sending queue */ - LIST_ADDQ(&agent->rt[tid].sending_queue, &ctx->list); + /* Add the SPOE context in the sending queue if the stream has no applet + * already assigned and wakeup all idle applets. Otherwise, don't queue + * it. */ _HA_ATOMIC_ADD(&agent->counters.nb_sending, 1); spoe_update_stat_time(&ctx->stats.tv_request, &ctx->stats.t_request); ctx->stats.tv_queue = now; + if (ctx->spoe_appctx) + return 1; + LIST_ADDQ(&agent->rt[tid].sending_queue, &ctx->list); SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p" " - Add stream in sending queue"