Honor the times argument of the count command after cd by CCCLL · Pull Request #16531 · apache/dubbo · GitHub
Skip to content

Honor the times argument of the count command after cd - #16531

Open
CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:qos-count-times-after-cd
Open

CCCLL wants to merge 1 commit into
apache:3.3from
CCCLL:qos-count-times-after-cd

Conversation

@CCCLL

@CCCLL CCCLL commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

Fixes #16530.

After cd <service>, the QoS telnet command count <method> <times> read the times from args[2], which only exists when the service name is given as well. count sayHello 10 after cd therefore printed the statistics once instead of ten times.

This PR reads the times from the argument after the method in both forms. Without cd the parsing is unchanged.

Behavior change

  • After cd, count <method> <times> now prints the statistics <times> times instead of once.
  • After cd, a non-numeric second argument (for example count sayHello x) is now rejected with Illegal times x, must be integer., as it already is without cd, instead of being ignored. A third argument after cd is no longer used as the times.
  • Without cd, nothing changes.

Verification

  • New CountTelnetTest#testCountTimesWithDefaultService (count sayHello 2 with a default service) fails before the change (only one result is sent) and passes after it.
  • Compared the old and new argument parsing for every combination of up to four arguments taken from a service name, a method name, a number, a non-number and an empty string, with and without a default service: without cd the result is the same for every input; with cd it differs only when the first argument is not a number and there are at least two arguments.
  • mvn verify -pl dubbo-plugin/dubbo-qos: 108 tests, 0 failures (5 skipped, the @Disabled GenericServiceTest); spotless and checkstyle are clean.
  • End to end, a provider with QoS enabled, commands sent over telnet:
Commands before after
cd repro.Echo, count length 3 1 table 3 tables
count repro.Echo length 3 3 tables 3 tables
cd repro.Echo, count 3 3 tables 3 tables
cd repro.Echo, count length x 1 table Illegal times x, must be integer.

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?

After "cd <service>", the QoS telnet command "count <method> <times>"
read the times from the third argument, which only exists when the
service name is given as well, so "count sayHello 10" printed the
statistics once instead of ten times.

Read the times from the argument after the method in both forms. After
"cd", an invalid times value is now rejected with "Illegal times ...",
as it already is without "cd", instead of being ignored.

Fixes apache#16530
@codecov-commenter

codecov-commenter commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.92%. Comparing base (cb05763) to head (836ea5d).
⚠️ Report is 2 commits behind head on 3.3.

Files with missing lines Patch % Lines
...org/apache/dubbo/qos/command/impl/CountTelnet.java 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16531      +/-   ##
============================================
+ Coverage     60.89%   60.92%   +0.02%     
- Complexity       15    11758   +11743     
============================================
  Files          1953     1953              
  Lines         89280    89281       +1     
  Branches      13477    13477              
============================================
+ Hits          54368    54391      +23     
+ Misses        29329    29305      -24     
- Partials       5583     5585       +2     
Flag Coverage Δ
integration-tests-java21 32.12% <0.00%> (+0.05%) ⬆️
integration-tests-java8 32.16% <0.00%> (-0.05%) ⬇️
samples-tests-java21 32.17% <0.00%> (+0.04%) ⬆️
samples-tests-java8 29.81% <0.00%> (+0.01%) ⬆️
unit-tests-java11 59.16% <0.00%> (+0.01%) ⬆️
unit-tests-java17 58.61% <0.00%> (+<0.01%) ⬆️
unit-tests-java21 58.63% <0.00%> (-0.02%) ⬇️
unit-tests-java25 58.55% <0.00%> (-0.01%) ⬇️
unit-tests-java8 59.17% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[Bug] QoS count command ignores the times argument after cd

2 participants