Skip to content

Refresh Webshart caption and image metadata caches on worker reload - #3291

Merged
bghira merged 1 commit into
mainfrom
fix/webshart-caption-cache-reload
Oct 20, 2026
Merged

bghira merged 1 commit into
mainfrom
fix/webshart-caption-cache-reload

Conversation

@bghira

@bghira bghira commented Oct 20, 2026

Copy link
Copy Markdown
Owner

After the main process refreshes Webshart buckets, the data-backend factory calls reload_cache() on each rank. That method only reloaded the bucket index, leaving workers with stale or empty caption and image-metadata caches. Caption requests could then fall back to per-sample backend lookups instead of using the cache already written by the main process.

Load image metadata and captions inside WebshartMetadataBackend.reload_cache(), and remove the redundant explicit loads from initialization and bucket discovery. Add a regression test using separate backend instances sharing real serialized caches. It checks both set_config values, replacement of stale captions and metadata, restored bucket membership, and caption access without backend lookups.

Validation:

  • Confirmed the new regression test fails against the implementation on main for both set_config values because it calls the caption backend.
  • .venv/bin/python -m unittest -v -f tests.test_webshart_backend: all 40 tests passed.
  • .venv/bin/python -m unittest -v -f: 7,059 tests run, 286 skipped, no failures, using LyCORIS 4.1.3.
  • Formatting, import sorting, and lint hooks passed.

@bghira
bghira merged commit 189aca3 into main Oct 20, 2026
2 checks passed
@bghira
bghira deleted the fix/webshart-caption-cache-reload branch October 20, 2026 16:42
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