Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(buffer_worker): avoid sending late reply messages to callers (r5.0) #10533

Merged
merged 1 commit into from Apr 26, 2023

Conversation

thalesmg
Copy link
Contributor

@thalesmg thalesmg commented Apr 26, 2023

Port of #10455 to release-50

Fixes https://emqx.atlassian.net/browse/EMQX-9635

During a sync call from process A to a buffer worker B, its call to the underlying resource C can be very slow. In those cases, A will receive a timeout response and expect no more messages from B nor C. However, prior to this fix, if B is stuck in a long sync call to C and then gets its response after A timed out, B would still send the late response to A, 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 in emqx_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:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@thalesmg thalesmg changed the title fix(buffer_worker): avoid sending late reply messages to callers fix(buffer_worker): avoid sending late reply messages to callers (r5.0) Apr 26, 2023
Fixes https://emqx.atlassian.net/browse/EMQX-9635

During a sync call from process `A` to a buffer worker `B`, its call
to the underlying resource `C` can be very slow.  In those cases, `A`
will receive a timeout response and expect no more messages from `B`
nor `C`.  However, prior to this fix, if `B` is stuck in a long sync
call to `C` and then gets its response after `A` timed out, `B` would
still send the late response to `A`, polluting its mailbox.
@thalesmg thalesmg force-pushed the fix-late-reply-buf-worker-r50 branch from 50485b9 to c53741a Compare April 26, 2023 16:18
Copy link
Member

@zmstone zmstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@thalesmg thalesmg marked this pull request as ready for review April 26, 2023 17:44
@thalesmg thalesmg requested a review from a team as a code owner April 26, 2023 17:44
@thalesmg thalesmg merged commit 307d081 into emqx:release-50 Apr 26, 2023
89 checks passed
@thalesmg thalesmg deleted the fix-late-reply-buf-worker-r50 branch April 26, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants