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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(rule_engine): don't increment unknown counter on unrecoverable er… #10327
fix(rule_engine): don't increment unknown counter on unrecoverable er… #10327
Conversation
@@ -523,9 +525,7 @@ inc_action_metrics(R, RuleId) -> | |||
emqx_metrics_worker:inc(rule_metrics, RuleId, 'actions.success') | |||
end. | |||
|
|||
is_ok_result(ok) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
is already matched on line 511:
inc_action_metrics(ok, RuleId) ->
emqx_metrics_worker:inc(rule_metrics, RuleId, 'actions.success');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ok results has to be leaked down here anyway we can probably delete line 511 instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: this fix is applicable only for synchronous bridges. If a bridge is asynchronous, rule action statistics will count everything as success. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could we add simple test for this case? Could be in a follow up PR to avoid blocking this fix for the release, of course.
Also, maybe we need a changelog here?
True, I noticed this issue yesterday as well 🙈 |
…rors Closes: EMQX-8786
7134acd
to
aca65ca
Compare
|
@thalesmg , I'm going to merge it without tests in order not to block the release, as adding them may take some time. |
Closes: EMQX-8786
Fixes
Summary
🤖 Generated by Copilot at 7134acd
Fix rule engine crash bug and refactor
is_ok_result
function inemqx_rule_runtime.erl
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