fix: close log files in CommonRunGraph to prevent resource leak#102
fix: close log files in CommonRunGraph to prevent resource leak#102AR21SM wants to merge 1 commit intokrkn-chaos:mainfrom
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
please update the fork and rebase on main |
Signed-off-by: AR21SM <mahajanashishar21sm@gmail.com>
3e6dce3 to
c16d33b
Compare
done |
User description
Description
Fixes #101
Log files created in
CommonRunGraph()were never closed, causing a resource leak. Each scenario run leaked a file descriptor, which could lead to hitting OS limits during long-running graph executions.Added
defer file.Close()in the goroutine to ensure proper cleanup.Before:
After:
Documentation
No - this is a bug fix with no user-facing changes.
Related Documentation PR (if applicable)
N/A
PR Type
Bug fix
Description
Close log files in CommonRunGraph goroutine to prevent resource leak
Added defer statement to ensure file cleanup after orchestrator execution
Prevents file descriptor exhaustion during long-running graph executions
Diagram Walkthrough
File Walkthrough
common_functions.go
Add file close defer in goroutinepkg/scenarioorchestrator/common_functions.go
defer file.Close()statement in goroutine to ensure log filecleanup
defer wg.Done()to guarantee file closure beforegoroutine exit