Repository navigation
Store the ExoPlayer cache flag in a column instead of calling Python from SQL - #255
Merged
Merged
Conversation
…on from SQL v2026.5.3 registered a Python SQL function, is_exo_cache_name, on the one connection every thread shares. The sidebar's container counts and the three container Type filters called it once per container row. A query calling it holds SQLite's connection mutex and waits for the interpreter lock on each row, while a thread binding a parameter holds the interpreter lock and waits for that mutex, so opening the gallery of a case with many container rows froze the server. files.exo_cache now holds the answer. It is decided by exoprobe's rule when upsert_file inserts a row and again when a write changes orig_path, rel_path or path. Opening a case adds the column if it is missing and fills every row that has no value, found through a partial index so a case with none pays nothing. No function is registered on the connection any more, and a test fails if one comes back. tests/test_container_kinds.py reads the counts and filters from one thread while another writes, in a child process under a timeout. On the code before this change it froze on 10 runs of 10; with it, 15 runs of 15 finished in about 3 s. The filters and counts return the same rows as before on a fixture of archives, documents and cache pieces. Fixes #254 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Stores whether a row is an ExoPlayer cache file in a column, so no Python function runs inside SQLite on the shared case connection. Fixes #254.
files.exo_cacheis set when a row is written and when its name changes.Co-Authored-By: Claude Opus 5.5 [email protected]