Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent infinitely calling processIndexSession when assetindexdata is empty #16435

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Jan 15, 2025

Description

If you’re in the middle of indexing assets and you e.g. clear all caches via ./craft clear-caches/all, it’ll delete the contents of the assetindexdata table and will cause the indexing job to go into an infinite loop where processIndexSession() is constantly called with the indexing session stuck on the last item it was able to process, unable to progress.

When this happens, it’s also very hard to discard that indexing session via the UI as the row with the session’s data and the discard button is replaced each time the response from the processIndexSession() is received.

Solution:
When we’re not able to get the next item to process, check if there’s any data in the assetindexdata table at all, and if not, log a warning, stop the indexing session and return a failure.

Related issues

might be related to #16023

@i-just i-just requested a review from brandonkelly January 15, 2025 12:37
@brandonkelly brandonkelly merged commit 3c999a1 into 4.14 Jan 15, 2025
@brandonkelly brandonkelly deleted the bugfix/asset-indexing-session-infinite-loop branch January 15, 2025 14:58
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