Skip to content

prevent infinitely calling processIndexSession when assetindexdata is empty#16435

Merged
brandonkelly merged 4 commits into4.14from
bugfix/asset-indexing-session-infinite-loop
Jan 15, 2025
Merged

prevent infinitely calling processIndexSession when assetindexdata is empty#16435
brandonkelly merged 4 commits into4.14from
bugfix/asset-indexing-session-infinite-loop

Conversation

@i-just
Copy link
Copy Markdown
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