Fix a memory leak in parallel checkpoint related to thread pool management

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines, Storage Engines - Persistence
    • SE Persistence backlog
    • None

      There are Python test failures running against the parallel checkpoint branch indicating memory leaks with the following signatures (two signatures from the same failure). It appears as though shutting down the parallel checkpoint worker threads does not reliably free the sessions associated with those worker threads.

      [2026/03/13 13:26:43.273] ==2600==ERROR: LeakSanitizer: detected memory leaks
      [2026/03/13 13:26:43.276] Direct leak of 7264 byte(s) in 4 object(s) allocated from:
      [2026/03/13 13:26:43.276]     #0 0xffffb9d08064 in calloc /data/mci/f49c90f0be13703fc74cd438c017c2d0/toolchain-builder/tmp/build-llvm-v5.sh-WmZ/llvm-project-llvmorg/compiler-rt/lib/asan/asan_malloc_linux.cpp:75:3
      [2026/03/13 13:26:43.276]     #1 0xffffb5032c54 in __wt_calloc /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/os_common/os_alloc.c:68:14
      [2026/03/13 13:26:43.276]     #2 0xffffb53de710 in __wt_txn_init /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/txn/txn.c:2213:5
      [2026/03/13 13:26:43.276]     #3 0xffffb5220fbc in __open_session /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/session/session_api.c:2641:5
      [2026/03/13 13:26:43.276]     #4 0xffffb521fc5c in __wt_open_session /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/session/session_api.c:2727:5
      [2026/03/13 13:26:43.276]     #5 0xffffb5221d80 in __wt_open_internal_session /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/session/session_api.c:2761:5
      [2026/03/13 13:26:43.276]     #6 0xffffb53a93c8 in __thread_group_resize /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/support/thread_group.c:192:9
      [2026/03/13 13:26:43.276]     #7 0xffffb53aa5c8 in __wt_thread_group_create /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/support/thread_group.c:295:5
      [2026/03/13 13:26:43.276]     #8 0xffffb4bcf8f4 in __wt_checkpoint_parallel_thread_create /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/checkpoint/checkpoint_parallel.c:317:5
      [2026/03/13 13:26:43.276]     #9 0xffffb4cdcf24 in __wti_connection_workers /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/conn/conn_open.c:242:5
      [2026/03/13 13:26:43.276]     #10 0xffffb4c42570 in wiredtiger_open /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/conn/conn_api.c:3549:5
      
      

      and

      [2026/03/13 13:26:43.278] Direct leak of 512 byte(s) in 4 object(s) allocated from:
      [2026/03/13 13:26:43.278]     #0 0xffffb9d08260 in realloc /data/mci/f49c90f0be13703fc74cd438c017c2d0/toolchain-builder/tmp/build-llvm-v5.sh-WmZ/llvm-project-llvmorg/compiler-rt/lib/asan/asan_malloc_linux.cpp:82:3
      [2026/03/13 13:26:43.278]     #1 0xffffb50345d0 in __realloc_func /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/os_common/os_alloc.c:160:18
      [2026/03/13 13:26:43.278]     #2 0xffffb50347ec in __wt_realloc_noclear /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/os_common/os_alloc.c:198:13
      [2026/03/13 13:26:43.278]     #3 0xffffb5329834 in __wt_buf_grow_worker /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/support/scratch.c:52:9
      [2026/03/13 13:26:43.278]     #4 0xffffb5222b48 in __wt_buf_grow /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/include/buf_inline.h:24:9
      [2026/03/13 13:26:43.278]     #5 0xffffb527cca0 in __wt_buf_init /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/include/buf_inline.h:57:13
      [2026/03/13 13:26:43.278]     #6 0xffffb5274920 in __wt_buf_initsize /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/include/buf_inline.h:67:5
      [2026/03/13 13:26:43.278]     #7 0xffffb5221918 in __open_session /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/session/session_api.c:2690:5
      [2026/03/13 13:26:43.278]     #8 0xffffb521fc5c in __wt_open_session /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/session/session_api.c:2727:5
      [2026/03/13 13:26:43.278]     #9 0xffffb5221d80 in __wt_open_internal_session /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/session/session_api.c:2761:5
      [2026/03/13 13:26:43.278]     #10 0xffffb53a93c8 in __thread_group_resize /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/support/thread_group.c:192:9
      [2026/03/13 13:26:43.278]     #11 0xffffb53aa5c8 in __wt_thread_group_create /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/support/thread_group.c:295:5
      [2026/03/13 13:26:43.278]     #12 0xffffb4bcf8f4 in __wt_checkpoint_parallel_thread_create /data/mci/e34bddca24ba9b4294d7413c879fb03e/wiredtiger/src/checkpoint/checkpoint_parallel.c:317:5
      
      

            Assignee:
            Peter Macko
            Reporter:
            Alexander Gorrod
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: