⚡ Sangsakala Proxy 🏠 Home
Skip to content

Resource Leak in StateLogger Class #1211

Open

Description

@guptapratykshh

Summary

The StateLogger class in SQLancer suffers from serious resource leaks due to inadequate management of file handlers. File writers (logFileWriter, currentFileWriter, queryPlanFileWriter, reduceFileWriter) are created but never properly closed throughout the application lifecycle.

Problem

Multiple FileWriter instances are opened during testing operations, but their resources aren't systematically released when they're no longer needed. This leads to:

  • Accumulated open file descriptors during long test runs
  • Potential data loss from unflushed buffers
  • File locking issues that might prevent access to log files
  • Possible system resource exhaustion on extended testing sessions

Impact

Since SQLancer is designed to run for extended periods while testing database systems, these leaks can significantly impact system stability and test reliability. The longer SQLancer runs, the more resources are leaked, potentially causing the tool to fail after extended use.

Activity

  1. Saadmadni84 commented on Jan 18, 2026

    @Saadmadni84

    Hi, I’d like to work on this issue if it’s still open.

    My plan is to add an explicit lifecycle close() method to StateLogger
    that safely flushes and closes all FileWriter instances, and ensure it is
    invoked during shutdown to prevent resource leaks, without changing
    existing logging behavior.

    Please let me know if this approach aligns with the intended solution.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions