-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
ReindexAll -> getState() is not correct if the Indexer broke with PHP fatal error #11166
Comments
Hi @larsroettig |
Hi, @magento-engcom-team, I update the descriptions. I recommend changing reindexAll to : /**
* Regenerate full index
*
* @return void
* @throws \Exception
*/
public function reindexAll()
{
if ($this->getState()->getStatus() != StateInterface::STATUS_WORKING) {
$state = $this->getState();
$state->setStatus(StateInterface::STATUS_WORKING);
$state->save();
if ($this->getView()->isEnabled()) {
$this->getView()->suspend();
}
try {
$this->getActionInstance()->executeFull();
$state->setStatus(StateInterface::STATUS_VALID);
$state->save();
$this->getView()->resume();
} catch (\Exception $exception) {
$state->setStatus(StateInterface::STATUS_INVALID);
$state->save();
$this->getView()->resume();
throw $exception;
} catch (\Error $error) {
$state->setStatus(StateInterface::STATUS_INVALID);
$state->save();
$this->getView()->resume();
throw $error;
}
}
} |
Hi @larsroettig. Thank you for your report.
The fix will be available with the upcoming patch release. |
If some fatal PHP error happens in the indexing process. The status is not correct reset
to StateInterface::STATUS_INVALID
Preconditions
Steps to reproduce
bin/magento indexer:reindex **your_index_name**
Expected result
Actual result
The text was updated successfully, but these errors were encountered: