Skip to content

Conversation

@bagariarahul
Copy link

@bagariarahul bagariarahul commented Apr 8, 2025

Proper File Handle Management for StateLogger #1211
This PR ensures proper cleanup of file writers to prevent resource leaks during SQLancer's execution.
Changes:

  1. Implement closeWriters() method to handle all FileWriter cleanup
  2. Add cleanup in both normal execution and error paths
  3. Maintain all existing logging functionality
  4. Remove redundant individual writer close calls
    Benefits:
  5. Prevents file descriptor leaks in long-running tests
  6. Ensures log data is properly flushed
  7. More reliable resource management
  8. No impact on existing logging behavior
    The changes focus specifically on resource cleanup while keeping all logging functionality identical.

@mrigger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant