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

call AgentHealthServiceByName get error #9860

Open
xurwxj opened this issue Mar 10, 2021 · 3 comments
Open

call AgentHealthServiceByName get error #9860

xurwxj opened this issue Mar 10, 2021 · 3 comments
Labels
theme/catalog Relating to the catalog of nodes, services, and checks theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp

Comments

@xurwxj
Copy link

xurwxj commented Mar 10, 2021

status, services, err := client.Agent().AgentHealthServiceByName(serviceName)
	if err != nil {
		log.Errorf("failed to get service %s: %v", serviceName, err)
		return
	}

after parallel call 1000 times in a second between service a and b, will got following err:

ERROR: failed to get service a: invalid character 'Y' looking for beginning of value
ERROR: failed to get service b: invalid character 'Y' looking for beginning of value

service will resume after a while.

@jsosulska jsosulska added theme/catalog Relating to the catalog of nodes, services, and checks theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/bug Feature does not function as expected type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp waiting-reply Waiting on response from Original Poster or another individual in the thread and removed type/bug Feature does not function as expected labels Mar 10, 2021
@jsosulska
Copy link
Contributor

Hi @xurwxj ,

Thanks for posting, and welcome to the Consul repository :) Can you please provide some context as to what you are trying to do? What is the usecase for 1000 parallel calls in a second?

Please provide any additional details that may help us replicate this as well.

Happy Coding!

@ghost ghost removed the waiting-reply Waiting on response from Original Poster or another individual in the thread label Mar 10, 2021
@jkirschner-hashicorp
Copy link
Contributor

Hi @xurwxj,

We believe this happened because that API endpoint returns errors as a string rather than a JSON object. The API will try to unmarshall the error assuming it is JSON, but fails because it's an error string (not structured as a JSON object). The invalid character 'Y' looking for beginning of value message is likely the JSON unmarshall error.

That problem is being tracked in #10865. Recent progress has been made in PRs #11054 and #11158.

Therefore, I'm closing this issue as a duplicate.

Thanks!

@acpana
Copy link
Contributor

acpana commented Sep 29, 2021

#11158 didn't actually wrap these API paths so I think this issue is still valid.

I'm reopening this as I think we will be closing #10865

@acpana acpana reopened this Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/catalog Relating to the catalog of nodes, services, and checks theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics type/question Not an "enhancement" or "bug". Please post on discuss.hashicorp
Projects
None yet
Development

No branches or pull requests

4 participants