Skip to content

Commit

Permalink
Merge pull request #259 from bonitoo-io/fix/conn_leak
Browse files Browse the repository at this point in the history
fix: Leaking connections
  • Loading branch information
vlastahajek committed Jun 2, 2021
2 parents 5d1fff4 + dbef950 commit 5b2f2a3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
## Unreleased
### Features
[#256](https://github.com/influxdata/influxdb-client-go/pull/256) Allowing 'Doer' interface for HTTP requests
- [#256](https://github.com/influxdata/influxdb-client-go/pull/256) Allowing 'Doer' interface for HTTP requests

### Bug fixes
- [#259](https://github.com/influxdata/influxdb-client-go/pull/259) Fixed leaking connection in case of not reading whole query result on TLS connection


## 2.3.0 [2021-04-30]
### Breaking change
[#253](https://github.com/influxdata/influxdb-client-go/pull/253) Interface 'Logger' extended with 'LogLevel() uint' getter.
- [#253](https://github.com/influxdata/influxdb-client-go/pull/253) Interface 'Logger' extended with 'LogLevel() uint' getter.

### Features
[#241](https://github.com/influxdata/influxdb-client-go/pull/241),[#248](https://github.com/influxdata/influxdb-client-go/pull/248) Synced with InfluxDB 2.0.5 swagger:
- Setup (onboarding) now sends correctly retentionDuration if specified
- `RetentionRule` used in `Bucket` now contains `ShardGroupDurationSeconds` to specify the shard group duration.
- [#241](https://github.com/influxdata/influxdb-client-go/pull/241),[#248](https://github.com/influxdata/influxdb-client-go/pull/248) Synced with InfluxDB 2.0.5 swagger:
- Setup (onboarding) now sends correctly retentionDuration if specified
- `RetentionRule` used in `Bucket` now contains `ShardGroupDurationSeconds` to specify the shard group duration.

### Documentation
1. [#242](https://github.com/influxdata/influxdb-client-go/pull/242) Documentation improvements:
Expand Down
2 changes: 1 addition & 1 deletion api/http/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (o *Options) OwnHTTPClient() bool {
return o.ownClient
}


// Doer allows proving custom Do for HTTP operations
type Doer interface {
Do(*http.Request) (*http.Response, error)
}
Expand Down
9 changes: 9 additions & 0 deletions api/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@ func (q *QueryTableResult) Err() error {
return q.err
}

// Close reads remaining data and closes underlying Closer
func (q *QueryTableResult) Close() error {
var err error
for err == nil {
_, err = q.csvReader.Read()
}
return q.Closer.Close()
}

// stringTernary returns a if not empty, otherwise b
func stringTernary(a, b string) string {
if a == "" {
Expand Down

0 comments on commit 5b2f2a3

Please sign in to comment.