Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Memory leak with gorutiones in new relic plugin #17

Open
LinMAD opened this issue Jul 26, 2019 · 0 comments
Open

Memory leak with gorutiones in new relic plugin #17

LinMAD opened this issue Jul 26, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@LinMAD
Copy link
Owner

LinMAD commented Jul 26, 2019

When there is no internet connection, go routines will be not closed in the plugin for the new relic.

That affects memory overflow and crashes system.

Review the following code usages from here:

https://github.com/LinMAD/BitAccretion/blob/master/extension/newrelic/provider.go
`

go func(g *model.Graph) {
	log.Debug(fmt.Sprintf("Harvesting data from NewRelic API..."))
	nr.fetchMetricsWithGraph(g, log)
	isProcessed <- true
}(g)

for {
	select {
	case <-isProcessed:
		nr.pluginHealth = model.HealthNormal
		return *g, nil
	case <-timeout:
		log.Error("Timeout got from NewRelic provider...")
		nr.pluginHealth = model.HealthWarning
		return *g, nil
	}
}

`

@LinMAD LinMAD added the bug Something isn't working label Jul 26, 2019
@LinMAD LinMAD self-assigned this Jul 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant