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

Growing job count after upgrading to Craft 3.2 #4507

Closed
baileydoestech opened this issue Jul 10, 2019 · 10 comments
Closed

Growing job count after upgrading to Craft 3.2 #4507

baileydoestech opened this issue Jul 10, 2019 · 10 comments

Comments

@baileydoestech
Copy link

Description

After upgrading to Craft 3.2 in our development environment we are seeing a growing number of jobs all of which seem to be 'updating the search index'. The count is continually increasing despite no jobs failing as shown below.

image

  • Craft version: 3.2
  • PHP version: 7.3
  • Database driver & version: mySQL 5.7.35
@baileydoestech
Copy link
Author

In the time taken to submit the ticket this has increased further as shown below (the rate of growth is quite worrying).

image

@jasonmccallister
Copy link
Contributor

jasonmccallister commented Jul 10, 2019

@lukebailey silly question, but have you tried restarting the queue/run process?

I know Laravel requires the queue to stop when it gets an update to the application.

@brandonkelly
Copy link
Member

So a little background… in Craft 3.2 we moved updating search indexes to a queue job, to help speed up the initial element save, and reduce the likelihood of a deadlock occurring (#3197).

Also, when you update to Craft 3.2, all of your existing entry drafts and revisions need to be recreated to the new element-based versions. Which is also going to create elements for any Matrix blocks, Super Table blocks, etc..

Search indexes aren’t supposed to be created for drafts and revisions, so you shouldn't be seeing all of these additional jobs lining up in the queue as a result of the draft/revision conversion, but if you have either Super Table or Neo installed, they will need to be updated to implement BlockElementInterface before Craft will actually know whether they should be considered drafts/revisions. I’ll work with the developers to get that to happen now that 3.2 is out.

The extra queue jobs are pretty harmless and once the initial job is complete, the search jobs should run pretty quickly.

@baileydoestech
Copy link
Author

Ok great thanks for the info, would you guys recommend clearing out old draft/versions etc then as we have some entries with hundreds for versions each with pretty complex matrix/super table fields?

@brandonkelly
Copy link
Member

That shouldn’t be necessary, as Craft will only convert up to the maxRevisions config setting (50 by default).

@verbeeksteven
Copy link

I have also been experiencing this

Search indexes aren’t supposed to be created for drafts and revisions, so you shouldn't be seeing all of these additional jobs lining up in the queue as a result of the draft/revision conversion, but if you have either Super Table or Neo installed, they will need to be updated to implement BlockElementInterface before Craft will actually know whether they should be considered drafts/revisions. I’ll work with the developers to get that to happen now that 3.2 is out.

I have Super Table installed so I assume that is why but I have reverted my 3.2 updates for now as my queue grows exponentially to the point where it is huge and stops frontend. I get like 10000 search indexes with blitz cache clears and other things. And it seems to never end.

@baileydoestech
Copy link
Author

Ok so just to follow up this @brandonkelly, we are still seeing the issue when upgrading to 3.2.1 (locally) where the maxRevisions setting is limited to 10 versions. After running migrate/all and project-config/sync we see the job to re-save entires fail with the following.

2019-07-12 14:13:01 [-][-][-][info][yii\db\Command::execute] UPDATE craft_queueSETfail=1, dateFailed='2019-07-12 13:13:01', error='The process \"/usr/bin/php7.3 craft queue/exec \"2483\" \"300\" \"1\" \"\" --color=\" exceeded the timeout of 300 seconds.' WHERE id='2483' 2019-07-12 14:13:01 [-][-][-][profile begin][yii\db\Command::execute] UPDATE craft_queueSETfail=1, dateFailed='2019-07-12 13:13:01', error='The process \"/usr/bin/php7.3 craft queue/exec \"2483\" \"300\" \"1\" \"\" --color=\" exceeded the timeout of 300 seconds.' WHERE id='2483' 2019-07-12 14:13:02 [-][-][-][profile end][yii\db\Command::execute] UPDATE craft_queueSETfail=1, dateFailed='2019-07-12 13:13:01', error='The process \"/usr/bin/php7.3 craft queue/exec \"2483\" \"300\" \"1\" \"\" --color=\" exceeded the timeout of 300 seconds.' WHERE id='2483' 201

After this the queue seems to get flooded with a growing number of jobs to update search indexes.

My solution right now is to truncate the queue table in the DB and everything starts to calm down, however do I need to resave all items for the Craft 3.2 changes to take effect or can we just wait until a user edits the page for it to be resaved?

@baileydoestech
Copy link
Author

FYI we have SuperTable as well which could be the culprit then, no Neo but we have Spoon instead

@verbeeksteven
Copy link

@lukebailey I've been doing the same thing to the point where it never ends. I've left it for a few hours and ended up with 55,000 queue items. So at this point I've reverted to 3.1.

@baileydoestech
Copy link
Author

baileydoestech commented Jul 12, 2019

ha haven't left it that long yet - killed it when I reached 20000 items or my Macbook might explode. Going to raise separate tickets in the plugin repos as this isn't really a Craft core issue just in case anyone else sees the same issue

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

No branches or pull requests

4 participants