Add a test for broadcast.fail.percent rounding down to a zero threshold by CCCLL · Pull Request #16519 · apache/dubbo · GitHub
Skip to content

Add a test for broadcast.fail.percent rounding down to a zero threshold - #16519

Open
CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:broadcast-fail-percent-rounding-test
Open

CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:broadcast-fail-percent-rounding-test

Conversation

@CCCLL

@CCCLL CCCLL commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

Follow-up to #16516 (issue #16515), as suggested by @EarthChen in the review of #16516.

  • Adds BroadCastClusterInvokerTest#testFailPercentRoundingDownToZero. The failure threshold is invokers.size() * broadcast.fail.percent / 100, so with four providers and broadcast.fail.percent=10 it is 0, and the broadcast has to stop at the first failed provider, as with a percentage of 0. The test makes the second provider fail, so it also checks that the broadcast does not stop before the first failure, and asserts that the third and fourth providers are not called.
  • Fixes the code comment in BroadcastClusterInvoker that calls the parameter broadcast.fail.threshold. The key is broadcast.fail.percent, and has been since it was added in fix the bug of broadcast cluster invoke #7174.

No behavior change.

Verification

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

Follow-up to apache#16516. The failure threshold is
invokers.size() * broadcast.fail.percent / 100, so with four providers a
percentage of 10 also gives a threshold of 0 and the broadcast has to
stop at the first failed provider, as with a percentage of 0.

Also fix the code comment that calls the parameter
broadcast.fail.threshold; the key is broadcast.fail.percent.
@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

2 participants