vinyl: fix fiber leak in worker thread
We join a fiber that executes a dump/compaction task only at exit while we mark all fibers as joinable. As a result, fibers leak, which eventually leads to a crash: src/lib/small/small/slab_arena.c:58: munmap_checked: Assertion `false' failed. Here's the stack trace: munmap_checked mmap_checked slab_map slab_get_with_order mempool_alloc fiber_new_ex fiber_new cord_costart_thread_func cord_thread_func start_thread clone Let's fix this issue by marking a fiber as joinable only at exit, before joining it. The fiber is guaranteed to be alive at that time, because it clears vy_worker::task before returning, while we join it only if vy_worker::task is not NULL. Fixes commit 43b4342d ("vinyl: fix worker crash at exit").
Loading
Please register or sign in to comment