I am using Background Process with Ultimate Cron and I am continually getting jobs that are running behind schedule. I have a continuous feed of data that is supposed to be downloaded on every cron run, and the cron jobs are getting backed up and this feed is not updating.

How do I troubleshoot this issue? I'm not seeing clear documentation - the only example is for someone with a Serial setup. I am under the impression that Background Process is superior (because it allows for parallelization, and thus faster thoroughput).

Is there a way to prioritize a particular type of cron job?

Is there a way to prevent behind schedule jobs?

Comments

nravens’s picture

I also have a similar issue with cron jobs running behind schedule. My Search - Update Indexes doesn't seem to be running and search index shows 0% indexed and the number of items to index doesn't come down with each run.

The log shows:
Notice: Trying to get property of non-object in _node_index_node() (line 2788 of /usr/www/users/thejoufqpb/modules/node/node.module).
Warning: Creating default object from empty value in node_build_content() (line 1398 of /usr/www/users/thejoufqpb/modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1401 of /usr/www/users/thejoufqpb/modules/node/node.module).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 379 of /usr/www/users/thejoufqpb/modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1413 of /usr/www/users/thejoufqpb/modules/node/node.module).
Error running search_cron: exception 'EntityMalformedException' with message 'Missing bundle property on entity of type node.' in /usr/www/users/thejoufqpb/includes/common.inc:7879
Stack trace:
#0 /usr/www/users/thejoufqpb/modules/field/field.multilingual.inc(268): entity_extract_ids('node', Object(stdClass))
#1 /usr/www/users/thejoufqpb/modules/field/field.attach.inc(1151): field_language('node', Object(stdClass), NULL, 'en')
#2 /usr/www/users/thejoufqpb/modules/node/node.module(1413): field_attach_prepare_view('node', Array, 'search_index', 'en')
#3 /usr/www/users/thejoufqpb/modules/node/node.module(1336): node_build_content(false, 'search_index', 'en')
#4 /usr/www/users/thejoufqpb/modules/node/node.module(2791): node_view(false, 'search_index')
#5 /usr/www/users/thejoufqpb/modules/node/node.module(2773): _node_index_node(Object(stdClass))
#6 [internal function]: node_update_index()
#7 /usr/www/users/thejoufqpb/includes/module.inc(905): call_user_func_array('node_update_ind...', Array)
#8 /usr/www/users/thejoufqpb/modules/search/search.module(363): module_invoke('node', 'update_index')
#9 [internal function]: search_cron(Array)
#10 /usr/www/users/thejoufqpb/sites/all/modules/ultimate_cron/ultimate_cron.job.inc(332): call_user_func_array('search_cron', Array)
#11 /usr/www/users/thejoufqpb/sites/all/modules/ultimate_cron/ultimate_cron.plugin.inc(998): UltimateCronJob->invoke()
#12 /usr/www/users/thejoufqpb/sites/all/modules/ultimate_cron/ultimate_cron.job.inc(474): UltimateCronLauncher->run(Object(UltimateCronJob))
#13 /usr/www/users/thejoufqpb/sites/all/modules/ultimate_cron/plugins/ultimate_cron/launcher/serial.class.php(226): UltimateCronJob->run()
#14 /usr/www/users/thejoufqpb/sites/all/modules/ultimate_cron/ultimate_cron.job.inc(394): UltimateCronSerialLauncher->launch(Object(UltimateCronJob))
#15 /usr/www/users/thejoufqpb/sites/all/modules/ultimate_cron/plugins/ctools/export_ui/ultimate_cron_job_ctools_export_ui.class.php(173): UltimateCronJob->launch()
#16 [internal function]: ultimate_cron_job_ctools_export_ui->run_page(false, Array, Object(UltimateCronJob))
#17 /usr/www/users/thejoufqpb/sites/all/modules/ctools/includes/export-ui.inc(469): call_user_func_array(Array, Array)
#18 [internal function]: ctools_export_ui_switcher_page('ultimate_cron_j...', 'run', Object(UltimateCronJob))
#19 /usr/www/users/thejoufqpb/includes/menu.inc(527): call_user_func_array('ctools_export_u...', Array)
#20 /usr/www/users/thejoufqpb/index.php(21): menu_execute_active_handler()
#21 {main}

Anyone have any ideas what I need to be checking?

littledynamo’s picture

Same problem here, manually triggering the jobs to run results in them running forever (permanent egg timer icon). There are no errors in the dblog on my system.

Chris Charlton’s picture

Ditto on the results running forever. I have let it run and after several minutes it times out or keeps spinning. Not sure yet why with zero apparent error logs.

sandyg28’s picture

I am also getting same error,
Notice: Trying to get property of non-object in _node_index_node() (line 2788 of /local/www/html/path/modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1401 of /local/www/html/path/modules/node/node.module).
Notice: Undefined property: stdClass::$type in _node_extract_type() (line 379 of /local/www/html/path/modules/node/node.module).
Notice: Undefined property: stdClass::$nid in node_build_content() (line 1413 of /local/www/html/path/modules/node/node.module).

The cron was triggered manually few times, could that be reason? anyone?

littledynamo’s picture

Component: Documentation » Code
Priority: Normal » Major

Bumping to major. The module is unusable in some situations.

Anonymous’s picture

Chiming in to say that for me as well with Background process all jobs end up getting behind schedule, cron tasks are not actually getting done. Only with Background process out of the picture do cron jobs get done, but then there is another problem in that the jobs are not run according to the defined schedule, only sporadically.

nravens’s picture

Not sure if this will be helpful to anyone else but my issue was resolved by doing what was suggested here: fixed-problem-search-index-stucked-entitymalformedexception

arnested’s picture

Issue tags: +background_process
nravens’s picture

I still had some jobs that indicated as running for too long but didn't actually seem to be running, e.g. search cron. This is what I think was was causing other jobs to fall behind and cause the problem with jobs falling behind schedule.

What seems to have worked for me:
I set the "admin/config/system/cron/launcher/serial" where "LAUNCHING OPTIONS - Maximum number of launcher threads" to "3"

This helped clear up the jobs that were falling behind but I still had the jobs that were stuck running for too long. To solve this I edited these jobs to run more frequently but in smaller batches where possible and set the "job lockout timeout" to between 180 and 300 seconds instead of the default 3600 seconds.

Cron jobs seem to be running smoothly and search and subscription mail crons are updating nicely.

Hope this is helpful to some else.

arnested’s picture

Status: Active » Closed (outdated)

I'm closing this since Drupal 7 is now unsupported and there will be no more development on the Drupal 7 branch of Ultimate Cron either.

Thank you for taking the time and effort in reporting this issue, even though it never got resolved.