fix(buffer_worker): avoid sending late reply messages to callers (r5.0) #10533
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Port of #10455 to
release-50
Fixes https://emqx.atlassian.net/browse/EMQX-9635
During a sync call from process
A
to a buffer workerB
, its call to the underlying resourceC
can be very slow. In those cases,A
will receive a timeout response and expect no more messages fromB
norC
. However, prior to this fix, ifB
is stuck in a long sync call toC
and then gets its response afterA
timed out,B
would still send the late response toA
, polluting its mailbox.Summary
馃 Generated by Copilot at 50485b9
Fixed a noisy error log caused by late replies from slow synchronous calls to external resources. Exported and used
reply_call/2
function inemqx_resource_buffer_worker
to handle late replies gracefully. Added a test case and a changelog entry for the fix.PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update