Generate transforms by the specified index from Assets Controller #15402
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.
Description
TL;DR: When passing a transform index ID to
/actions/assets/generate-transforms
, the action should generate that exact index.Full Story: We launched a site running 4.10.4 and somehow ended up with duplicate rows in our
imagetransformindex
table. Our template eager loaded transforms, and it yields the second row from the table (id: 21) for a particular transform. When the Assets Controller went to generate the transform by ID, it actually queries theimagetransformindex
table based on the attributes of the transform, which would yield the first row (id: 20) and not the actual row requested (id: 21). This would yield an ever-growing queue of image transformations that would never flip thefileExists
to 1 on id 21.I recognize this solution deals with symptoms and not the root problem, but at least it prevents the queue from infinitely pushing image transforms jobs. I believe this fix is also applicable for 5.x.
We did have multiple processes in our supervisor config, so that was probably the root cause of the duplicate rows. I used these queries to diagnose and clean up the table:
Related issues
#12453