mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #568] [MERGED] bink_play: clean up failed cache writes (BINK-CACHE-CLEANUP) #612
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#612
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/568
Author: @JiyouProt
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:codex/bink-cache-cleanup📝 Commits (1)
09867f4bink_play: remove cache staging files after failed publication (BINK-CACHE-CLEANUP)📊 Changes
2 files changed (+97 additions, -7 deletions)
View changed files
➕
tests/test_bink_play_cache_write.py(+87 -0)📝
tools/bink_play.py(+10 -7)📄 Description
Claimed in the coordination issue as: BINK-CACHE-CLEANUP
What and why
A failed write or final replacement leaves
bink_names.*.partin the persistent cache directory. Repeated failures accumulate incomplete files even though the previous cache is still usable.Clean up the unique staging path in a finally block after the file handle is closed, including on interruption. Successful publication still uses the existing atomic replacement. Only the current writer's temporary file is removed.
Three synthetic regressions cover a write error, replacement errors/interruption, and an outer save failing after an overlapping inner save successfully publishes. They verify the old or newly published cache survives and an unrelated .part neighbor stays untouched. All three fail against the original source.
This is independent of #566 (uncached lookup storage). The production patch applies cleanly on that head; the new tests live in a separate file so the test additions do not collide.
Tested
Windows 11 build 26300.9974, Python 3.14.3, based on main
1c93c86970.python -I tests/test_bink_play_cache_write.py: 3 passed.python -I tests/test_bink_play.py: 10 passed.python -I tests/test_text_write_line_endings.py: 3 passed.git diff --check: passed.GPUs tested: n/a — standard-library tests with synthetic names only, no game data, codec or GPU needed.
AI-assisted: yes, Codex.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.