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

Memory leak with gorutiones in new relic plugin #17

@LinMAD

Description

@LinMAD

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
	}
}

`

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions