Implement bounded transient database retries and accurate failure diagnostics #44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
SPEC.md section 11 requires bounded retries for transient database contention. Plugin state operations currently translate SQLite errors directly into failures; connection timeout waiting is not an operation-level retry policy. The sync lock-failure test expects immediate failure.
The broad exception handler in sync also reports write failures as a playlist database that “could not be opened,” potentially attributing a beets write failure to the wrong store.
Proposed change
Retry known transient database failures at appropriate idempotent transaction boundaries. Preserve the original cause and identify the affected store and operation in user-facing diagnostics. Do not retry schema, constraint, permission, invalid-data, or persistent I/O failures. Account for any retries already provided by upstream stores.
Acceptance criteria
References:
beetsplug/appleplaylists/state.py:111-161,sync.py:203-210,tests/test_sync.py:460. Audit finding 3 (medium).