fix(kanban): close board count connections in boards list - #30031
Closed
worlldz wants to merge 1 commit into
Closed
Conversation
worlldz
force-pushed
the
fix-kanban-boards-fd-leak
branch
from
May 21, 2026 21:01
4593504 to
32167f6
Compare
worlldz
force-pushed
the
fix-kanban-boards-fd-leak
branch
from
May 22, 2026 03:45
32167f6 to
a075646
Compare
worlldz
force-pushed
the
fix-kanban-boards-fd-leak
branch
from
May 22, 2026 04:24
a075646 to
09c9543
Compare
23 tasks
Collaborator
|
Closing as already fixed on main — landed via commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #30027
hermes kanban boards listcurrently leaks sqlite file descriptors across boards in long-lived processes.The root cause is
_board_task_counts()inhermes_cli.kanban, which useswith kb.connect(board=slug) as conn:. Forsqlite3.Connection, that pattern manages transaction scope but does not close the handle.Since
boards listcalls that helper once per board, per-boardkanban.db,kanban.db-wal, andkanban.db-shmhandles can accumulate in a single process.This patch switches that read path to explicit closing and adds regression coverage for sqlite-like connections whose context manager does not call
close().Validation:
uv run --extra dev pytest tests/hermes_cli/test_kanban_boards.py -q -k 'board_task_counts_closes_sqlite_like_connection or boards_list_default_only or boards_create_and_switch'Result:
3 passed in 10.36sLive repro before fix:
{'base': 5, 'after': 68, 'delta': 63, 'boards': 21}Live repro after fix:
{'base': 5, 'after': 5, 'delta': 0, 'boards': 21}