Description
In pkg/scenarioorchestrator/common_functions.go (line 69), log files are created with os.Create() but never closed. Each scenario run leaks a file descriptor.
Location: pkg/scenarioorchestrator/common_functions.go:69-85
file, err := os.Create(path.Clean(filename))
if err != nil {
commChannel <- &models.GraphCommChannel{...}
return
}
// ... file passed to RunAttached but never closed
Expected behavior
Add defer file.Close() in the goroutine:
go func() {
defer file.Close()
defer wg.Done()
_, err = orchestrator.RunAttached(..., file, file, ...)
// ...
}()