From c6fc0ec8cd404771d332408605d76e07a0be1ab7 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Wed, 8 Feb 2023 14:03:40 +0300 Subject: [PATCH] fix(bufworker): do not avoid retry if inflight table is full Otherwise there's no other piece of code that would retry the inflight queries in that case. --- .../src/emqx_resource_buffer_worker.erl | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/emqx_resource/src/emqx_resource_buffer_worker.erl b/apps/emqx_resource/src/emqx_resource_buffer_worker.erl index 29fe79d09..b25725c41 100644 --- a/apps/emqx_resource/src/emqx_resource_buffer_worker.erl +++ b/apps/emqx_resource/src/emqx_resource_buffer_worker.erl @@ -334,12 +334,7 @@ resume_from_blocked(Data) -> {single, Ref, Query} -> %% We retry msgs in inflight window sync, as if we send them %% async, they will be appended to the end of inflight window again. - case is_inflight_full(InflightTID) of - true -> - {keep_state, Data}; - false -> - retry_inflight_sync(Ref, Query, Data) - end; + retry_inflight_sync(Ref, Query, Data); {batch, Ref, NotExpired, Expired} -> update_inflight_item(InflightTID, Ref, NotExpired), NumExpired = length(Expired), @@ -347,12 +342,7 @@ resume_from_blocked(Data) -> NumExpired > 0 andalso ?tp(buffer_worker_retry_expired, #{expired => Expired}), %% We retry msgs in inflight window sync, as if we send them %% async, they will be appended to the end of inflight window again. - case is_inflight_full(InflightTID) of - true -> - {keep_state, Data}; - false -> - retry_inflight_sync(Ref, NotExpired, Data) - end + retry_inflight_sync(Ref, NotExpired, Data) end. retry_inflight_sync(Ref, QueryOrBatch, Data0) ->