Skip to content

Adding a method to close the FileWriter while maintaining the existing #1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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