Skip to content

fix: avoid cover thumbnail DB deadlock#1346

Open
navels wants to merge 1 commit into
crocodilestick:mainfrom
navels:fix/cover-thumbnail-deadlock
Open

fix: avoid cover thumbnail DB deadlock#1346
navels wants to merge 1 commit into
crocodilestick:mainfrom
navels:fix/cover-thumbnail-deadlock

Conversation

@navels
Copy link
Copy Markdown

@navels navels commented May 11, 2026

Summary

  • defer cover thumbnail regeneration until after the Calibre metadata edit transaction commits
  • pass the committed book path and last-modified timestamp into single-book thumbnail refreshes
  • avoid reopening metadata.db for that single-book refresh path when committed snapshot data is available
  • add regression coverage for the ordering/snapshot contract

Testing

  • pytest tests/unit/test_thumbnail_deadlock_regression.py -q
  • python -m py_compile cps/editbooks.py cps/helper.py cps/tasks/thumbnail.py tests/unit/test_thumbnail_deadlock_regression.py

Refs #1256 and #1256 (comment)

@new-usemame
Copy link
Copy Markdown

Backported into Calibre-Web-NextGen v4.0.46 at 34f1985. Drop-in image for users hitting this: ghcr.io/new-usemame/calibre-web-nextgen:latest. Thanks @navels.

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.

2 participants