To reproduce:
- Create a PHP node with any fatal error
- Run cron
Expected / Desired behavior:
- Watchdog entry that a particular node is broken
- Search indexing continues beyond failed node
Actual behavior:
- Cron fails with "Cron run exceeded the time limit and was aborted"
- Search indexing never gets beyond failed node
Suggested remedy:
Suggest trapping errors in the _node_index_node() loop of node_update_index() and watchdogging errored node IDs -- perhaps by calling @_node_index_node() and checking $php_errormsg; tho not sure if this is a good idea / compliant with current practices (i'm not finding best practices / coding standards re: error handling).
This may be called a corner case, but I've found a fair amount of forum activity around this error. In the case of a major version upgrade, there is a likelihood of PHP nodes calling functions in modules that no longer exist, calling outdated functions, or otherwise broken PHP. On a heavily customized, content-heavy site there is no avenue for testing all current content for basic validity (other than search indexing!)
Here is an opportunity to help upgrading developers find invalid pages, rather than generate a confusing and inaccurate error message.
I've considered that this may be a search issue or a cron issue, but the real source is node_update_index().
Comments
Comment #1
gpk commentedProbably a dupe of #361171: How to debug cron stoppage problems with bad PHP content.
See also #286263: Make search indexing smart to handle nodes wth php redirects.
Comment #2
jruberto commentedhumm, #361171: How to debug cron stoppage problems with bad PHP content sort of seems like it might have been, but that has become a v8.x feature request for something more robust.
I'm calling the "Cron run exceeded the time limit and was aborted" error a bug worthy of fixing before 8.x, and I also believe it's a node.module issue rather than a search.module issue. Willing to be wrong.
Comment #3
gpk commentedAh, maybe you want #308808: Drupal_cron_cleanup paints the wrong picture then.
Comment #4
jhodgdonThis is definitely a duplicate of #752184: Keep running cron when bad PHP content is encountered
It has been determined to be a feature request, because asking Drupal not to crash when someone enters crash-prone PHP code into a node is a feature. It's not a Drupal bug that's causing the cron run to crash, but a crash in the code that was entered by the user.