influxdata / influxdata/influxdb-client-go
WriteAPIBlocking and QueryAPI got EOF for sometime
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 653
- Forks
- 120
- Avg merge
- 3m
- Merged PRs (30d)
- 3
Description
### Specifications
* Client Version: v2.9.0
* InfluxDB Version: 1.8.9
* Platform: CentOS 7.9
### Steps to reproduce
This problem occurs occasionally.
In my scenario, Points are generated periodically and written to InfluxDB.
```go
writeAPI := l.data.InfluxdbClient.WriteAPIBlocking("", constant.InfluxdbBucket)
err := writeAPI.WritePoint(context.TODO(), toLoadPoint(entityId, loadType, resourceLoad, ts))
```
Meanwhile, another goroutine periodically reads data from InfluxDB.
```go
queryAPI := l.data.InfluxdbClient.QueryAPI("")
cmd := toListLoadsQueryCmd(entityId, start, end, groupByCfg, loadTypes)
result, err := queryAPI.Query(context.TODO(), cmd)
```
### Expected behavior
No error returned.
### Actual behavior
Write points to InfluxDB sometimes got this error:
```
Post "https://{INFLUXDB_DOMAIN}/api/v2/write?bucket=chief%2Fautogen&org=&precision=ns": EOF
```
Read data from InfluxDB sometimes got this error:
```
Post "https://{INFLUXDB_DOMAIN}/api/v2/query?org=": EOF
```
### Additional info
I noticed that the default value of `Close` for the generated `http.request` (in `doHTTPRequestWithURL` function) is false, just set it to true may be able to solve this problem.
If there are other scenarios to consider, whether the `requestCallBack` function used in `DoPostRequest` is released to the user in NewClient.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with doHTTPRequestWithURL and inspect how the generated http.request handles Close for the write and query calls. Trace DoPostRequest and the requestCallBack path from NewClient, then reproduce the concurrent WriteAPIBlocking and QueryAPI requests described in the issue. Done means identifying the cause of the intermittent EOF and confirming the fix for both endpoints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100