Skip to content

fix(sensor): close Cursor SQLite connections - #87

Open
barisozbas wants to merge 2 commits into
mainfrom
pr/cursor-close-database
Open

fix(sensor): close Cursor SQLite connections#87
barisozbas wants to merge 2 commits into
mainfrom
pr/cursor-close-database

Conversation

@barisozbas

Copy link
Copy Markdown
Collaborator

What changed

Cursor SQLite connections are now closed deterministically after parsing.

  • Releases the connection on successful reads, empty results, and exceptions.
  • Keeps existing parsing and error handling behavior unchanged.
  • Adds a regression test using a real temporary SQLite database.

Why

Leaked read connections can retain file descriptors and database locks across repeated collection runs.

Validation

  • pytest -q Sensor/tests
  • ruff check Sensor/adr_sensor/parsers/cursor_parser.py Sensor/tests/test_parsers.py

Summary:
Intent:
- Release Cursor database resources reliably after parsing.

Changes:
- Close connections on success and failure paths.
- Verify closure against a real temporary SQLite database.
@barisozbas
barisozbas marked this pull request as ready for review September 7, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant