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
[4.x]: 'Generating pending image transforms' jobs are all repeating the same work #12274
Comments
At first glance, it seems somewhat related to: #11970 and most importantly #12047. As per @angrybrad comment here: #12047 (comment) we recommend only running one queue worker. |
The issue I still get when only running a single queue-worker is when the job runs out of it's timeout (which can easily happen when there are thousands of images to be transformed in a single job), it will not save any of it's progress (or mark the timed-out transform as error) and starts again at the start of all pending image transforms, encounters the same timeout-causing transform, times out again and therefor never reaches the rest of the pending transforms. Basically, the main problem is that this single job sometimes takes way too long due to those retries, which causes other jobs to be needlessly delayed. |
Right, thanks for clarifying. One thing you can do from your end is increase the default ttr in
Another thing to note is that I'd say, at the moment it's working as expected (with one queue worker), but we're discussing internally how we can make it perform better. |
This has been addressed in two ways:
|
Craft 3.7.64 and 4.3.7 have been released with that first fix. |
Craft 4.4 is out with the second fix now. |
Confirm we are seeing this too on 4.5.10 Is there any way we can disable the firing of the queue processing on login (given we have a cron job periodically running the queue process (ie * * * * * flock -n /container/application/queue.lock /usr/local/bin/php /container/application/craft queue/run >/dev/null 2>&1) Thanks |
GeneralConfig::$runQueueAutomatically sounds like what you need for that: Add to Or, add to |
in such case it just adds new line with Pending status every second |
Thanks for the responses. Should we be logging this as a new issue - I notice this one is closed.... |
@brandonkelly could you reopen the issue? |
@Bronskiy It looks like you are describing the expected behavior, if you read my previous comment (#12274 (comment)). |
Hi, ok it's Sunday here and I'm on our dev system so no other activity. I have added a video of what happens each time I log in and navigate to an item in the sidebar. Note it only starts queuing transformations when I click on something. The queue eventually clears (a couple of minutes). If I log out and back in, and choose the same entry in the sidebar, the transformations start with the same number of transformations to do. I've repeated this multiple times and get the same result every time. Note that all the queue entries have a Description of "null". https://share.cleanshot.com/jZ1vCbH7 I've also noted the load on the container (it's all transformation load) so this is not an insignificant process especially when we will have up to 10 people logged in to the backend at any one time once the system is live. I also note we have maybe 30 other CraftCMS sites where we don't see this behaviour, although this is the most complicated with 8 sites within the multisite setup. So it could be we are an edge case, but this behaviour is not expected or desired. Any help on this would be much appreciated - maybe I should be logging it somewhere else? Thanks. |
yes, but it looks like it generates it unlimited |
Hi, further to this, we cleared out some data yesterday and re-imported - the problem no longer exists, so we are wondering if one of our previous imports had some issues with images. Not sure, but we are not longer seeing any transforming of images as per my video above. Fingers crossed it stays this way. Cheers! |
We're seeing this on 4.5.10 and I've just upgraded to 4.7.1 and it seems to be continuing. Continual Generating image transform jobs getting created with the job data
I suspect it's something that's gone wrong with a |
@marina-moca when you say you cleared our some data and re-imported - what did you do? We're still trying to get to the bottom of this issue for our instance and we're only running a single worker. |
This ended up being related to SEOMatic and a site default meta image (gif) not having transforms enabled on it. Turned that setting on and the jobs stopped queueing. |
We have the same issue, had today 1.6M jobs in queue. Also seomatic in use but with the setting on. Any other ideas here? It's just on our stage enviroment. We are on 4.8.0 |
What happened?
Description
When the generateTransformsBeforePageLoad setting isn't set to TRUE, jobs are queued to generate pending transforms. However, these jobs seem to all do the same work when running concurrently, even though there is a 'inProgess' column in the imagetransformindex table.
Since all jobs do the same work, and don't reserve an image prior to starting the transform, all jobs come to a halt when a single image transform fails, as can be seen on this screenshot:
Steps to reproduce
Expected behavior
Image transforms are only handled by a single job at the same time, and are reserved to that worker when starting. Since a job is added for every single pending image transform, maybe that job should only handle that specific image instead of the whole queue in every job?
Actual behavior
Image transforms are only handled as completed when all image transforms in the job are completed.
Craft CMS version
v4.3.1
PHP version
8.0
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: