-
Notifications
You must be signed in to change notification settings - Fork 203
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
EZP-30635: Fixed infinite loop in Reindex Command on the last iteration #2664
Conversation
8aa6ffe
to
a3c7a7a
Compare
@@ -387,6 +389,10 @@ private function fetchIteration(Statement $stmt, $iterationCount) | |||
*/ | |||
private function getPhpProcess(array $contentIds, $commit) | |||
{ | |||
if (empty($contentIds)) { | |||
throw new RuntimeException("'--content-ids=' can not be empty on parallel sub process"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidArgumentException
seems to be a better choice here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamwojs InvalidArgumentException
should be used when the argument is not of an expected type, but here we expect array
and an array
it is, but empty. I think that RuntimeException
is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @adamwojs is right here, both exception about --iteration-count
and this one should rather use InvalidArgumentException
or InvalidArgumentValue
exception. (among those I also prefer InvalidArgumentException
here as it makes it possible to say what is wrong)
ok @mateuszbieniek and @adamwojs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 6b2f78f
6.7
When content-count % iteration-count === 0, aka when last iteration would have empty results, there would be faulty call to with empty ´--content-ids=´ causing whole new index process to start again with purge and everything.
TODO:
$ composer fix-cs
).