hashicorp / hashicorp/consul

call AgentHealthServiceByName get error

Open
#9,860 3 comments 0 reactions 0 assignees View on GitHub
theme/catalog theme/internals type/question
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

```
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.

Contributor guide

Open the contributing guide

Research direction

Start at the AgentHealthServiceByName entry point and reproduce the reported parallel calls between services a and b. Inspect how the client handles responses under concurrency; done means the calls no longer produce invalid JSON errors during the reported load.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.