Fix session leak in test/format checkpoint thread (open called instead of close at exit)

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Test Format
    • None
    • Storage Engines
    • 145.475
    • None
    • None

      Summary

      The checkpoint() thread function in test/format/checkpoint.c opens a WT_SESSION at the top via wt_wrap_open_session and uses it throughout its loop. At function exit it calls wt_wrap_open_session again instead of wt_wrap_close_session, leaking the session opened at the start. Every other thread function in test/format/ (alter.c, compact.c, backup.c, etc.) correctly calls wt_wrap_close_session at exit. This is a copy/paste error.

      Impact

      Test-only resource leak; no production code affected.

      File

      • test/format/checkpoint.c

      Fix

      // test/format/checkpoint.c — end of checkpoint()
      -wt_wrap_open_session(conn, &sap, NULL, NULL, &session);
      +wt_wrap_close_session(session);
       return (WT_THREAD_RET_VALUE);
      

      Notes

      Discovered during development on the WT-16973 clean-scrub eviction branch (PR #13605). Fix is independent of that feature and should be applied directly to develop.

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: