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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscriber api without count when the query number is more than subscriber count. #8196

Closed
KomachiSion opened this issue Apr 18, 2022 · 1 comment · Fixed by #8197
Closed
Labels
contribution welcome good first issue Good for newcomers kind/bug Category issues or prs related to bug.
Milestone

Comments

@KomachiSion
Copy link
Collaborator

Describe the bug
A clear and concise description of what the bug is.

The API /nacos/v1/ns/service/subscribers will return count 0 when the query number is more than subscriber count.

For example, service A has 5 subscribers, but when we query with pageNo=2&pageSize=1000, the result will be count=0, which is not expected.

The reason is the end will be smaller than start and so that subList throw exception.

            int count = subscribers.size();
            if (end > count) {
                end = count;
            }

Expected behavior
return right count number of subscribers.

Acutally behavior
return 0

How to Reproduce
Steps to reproduce the behavior:

  1. subscriber any service.
  2. call /nacos/v1/ns/service/subscribers with pageNo=2&pageSize=1000
  3. see the response count field

Desktop (please complete the following information):

  • Version nacos-server 2.X
  • Module naming

Additional context
Add any other context about the problem here.

@KomachiSion KomachiSion added good first issue Good for newcomers contribution welcome kind/bug Category issues or prs related to bug. labels Apr 18, 2022
@KomachiSion KomachiSion added this to the 2.1.0 milestone Apr 18, 2022
@onewe
Copy link
Collaborator

onewe commented Apr 18, 2022

@i will resolve it@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome good first issue Good for newcomers kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants