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

WriteAPIBlocking and QueryAPI got EOF for sometime #375

Open
yangsijie666 opened this issue Feb 21, 2023 · 0 comments
Open

WriteAPIBlocking and QueryAPI got EOF for sometime #375

yangsijie666 opened this issue Feb 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@yangsijie666
Copy link

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.

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.

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.

@yangsijie666 yangsijie666 added the bug Something isn't working label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant