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

Fix socket daemon errors #63

Merged
merged 3 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.3.3
version=0.3.4
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [v0.3.4](https://github.com/NodeFactoryIo/vedran-daemon/tree/v0.3.4)

[Full Changelog](https://github.com/NodeFactoryIo/vedran-daemon/compare/v0.3.3...v0.3.4)

### Fixed
- Fix socket and request memory leaks [\#63](https://github.com/NodeFactoryIo/vedran-daemon/pull/63) ([mpetrun5](https://github.com/mpetrun5))

### Added

### Changed

## [v0.3.3](https://github.com/NodeFactoryIo/vedran-daemon/tree/v0.3.3)

[Full Changelog](https://github.com/NodeFactoryIo/vedran-daemon/compare/v0.3.2...v0.3.3)
Expand Down
10 changes: 8 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ module github.com/NodeFactoryIo/vedran-daemon
go 1.15

require (
github.com/NodeFactoryIo/vedran v0.1.2-0.20201012103221-1832974f2e38
github.com/NodeFactoryIo/vedran v0.5.4-0.20210223103850-bbeee18776e9
github.com/felixge/tcpkeepalive v0.0.0-20160804073959-5bb0b2dea91e // indirect
github.com/go-co-op/gocron v0.3.1
github.com/gorilla/websocket v1.4.0
github.com/golang/mock v1.3.1 // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/gorilla/websocket v1.4.1
github.com/gosuri/uitable v0.0.4
github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/mapstructure v1.3.3
github.com/prometheus/common v0.13.0
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.6.1
go.etcd.io/bbolt v1.3.5 // indirect
)
247 changes: 247 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/lb/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ func (c *Client) do(req *http.Request, v interface{}) (*http.Response, error) {
} else if resp.StatusCode != 200 {
return nil, fmt.Errorf("Request %v returned invalid status code %d", req, resp.StatusCode)
}
defer resp.Body.Close()

if v != nil {
defer resp.Body.Close()
body, _ := ioutil.ReadAll((resp.Body))
err = json.Unmarshal(body, &v)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions internal/lb/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ func (ms *metricsService) Send(client node.Client) (*http.Response, error) {
return nil, err
}

resp.Body.Close()
return resp, err
}
1 change: 1 addition & 0 deletions internal/lb/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ func (ps *pingService) Send() (*http.Response, error) {
return nil, err
}

resp.Body.Close()
return resp, err
}