Because of core bug #600836: Batch API never terminates if you set $context['finished'] > 1 which was never backported to Drupal 6, if a $context['finished'] value greater than 1 is returned, then this causes an infinite loop. This can be triggered by a new node being added while a batch operation running on the entire node table is being run. This has been exposed in an actual contrib module with #1291898: Rebuild processing imaginary nodes so let's make sure people are aware of this issue in the batch example.

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB

I don't believe this can be tested, so let's just comment the heck out of it.

geerlingguy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

rfay’s picture

Resubmitting same patch to make sure testing system accepts it.

rfay’s picture

StatusFileSize
new1.18 KB

Sorry to make a mess of this issue, but using it for testing.

rfay’s picture

Status: Reviewed & tested by the community » Fixed

Well, anyway. I committed it.

http://drupalcode.org/project/examples/commitdiff/7b4cb24

Thanks so much!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.