Repository navigation
Refresh Webshart caption and image metadata caches on worker reload - #3291
Merged
Merged
Conversation
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.
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 bothset_configvalues, replacement of stale captions and metadata, restored bucket membership, and caption access without backend lookups.Validation:
set_configvalues 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.