You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "CCCLL (via GitHub)" <gi...@apache.org> on 2026/10/20 04:17:29 UTC

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

CCCLL opened a new issue, #16530:
URL: https://github.com/apache/dubbo/issues/16530

   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   `3.3` branch (cb05763298), OpenJDK 21, macOS. The argument parsing goes back to `CountTelnetHandler` in 2.0.7 and was carried over to the QoS `CountTelnet` in #8175.
   
   ### Steps to reproduce this issue
   
   1. Start a provider with QoS enabled and a dubbo service (here `repro.Echo` with a method `length`).
   2. Connect to the QoS port and run `cd repro.Echo`, then `count length 3`.
   
   The statistics table is printed once. Without `cd`, `count repro.Echo length 3` prints it three times, one second apart.
   
   `CountTelnet#execute` reads the times like this:
   
   ```java
   if (service == null || service.length() == 0) {
       service = args[0];
       method = args.length > 1 ? args[1] : null;
   } else {
       method = args.length > 0 ? args[0] : null;
   }
   if (StringUtils.isNumber(method)) {
       times = method;
       method = null;
   } else {
       times = args.length > 2 ? args[2] : "1";
   }
   ```
   
   After `cd`, the arguments are `[method, times]`, so `args[2]` does not exist and `times` falls back to `"1"`. (`count length 3 5` after `cd` runs five times.)
   
   ### What you expected to happen
   
   `count length 3` after `cd repro.Echo` prints the table three times, like `count repro.Echo length 3`. The usage message of the command also describes `cd XxxService` as an alternative to giving the service name (`count XxxService xxxMethod 10 ... or "cd XxxService" firstly`).
   
   ### Anything else
   
   `count 3` after `cd` (no method) already works, because a numeric first argument is taken as the times.
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [x] Yes I am willing to submit a pull request on my own!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] QoS count command ignores the times argument after cd [dubbo]

Posted by "LI123456mo (via GitHub)" <gi...@apache.org>.
LI123456mo commented on issue #16530:
URL: https://github.com/apache/dubbo/issues/16530#issuecomment-6382826250

   <img width="500" height="520" alt="Image" src="https://github.com/user-attachments/assets/7094e63f-092d-4d43-8969-cc0d6ce9ec7a" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] [Bug] QoS count command ignores the times argument after cd [dubbo]

Posted by "Ashutosh-Panda2004 (via GitHub)" <gi...@apache.org>.
Ashutosh-Panda2004 commented on issue #16530:
URL: https://github.com/apache/dubbo/issues/16530#issuecomment-6285317573

   Hi, I checked this on the `3.3` branch and I can confirm the parsing problem.
   
   I took the argument parsing block from `CountTelnet#execute` as it is on `3.3` and ran it in a small Java harness with the cases from this issue. This is what I got:
   
   ​```
   after cd, count length 3 -> service=repro.Echo method=length times=1
   no cd, count repro.Echo length 3 -> service=repro.Echo method=length times=3
   after cd, count 3 -> service=repro.Echo method=null times=3
   after cd, count length 3 5 -> service=repro.Echo method=length times=5
   ​```
   
   So after `cd`, `count length 3` really does fall back to `times=1`, because the code reads `args[2]` and that argument only exists when the service name is given as well. The `count 3` form works for the reason given in the issue, since a numeric first argument is taken as the times.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org