So there are several issues with using a batch job as opposed to queue processes.

  1. Batch jobs depend on the browser. This is fine for something like file uploads where the browser must be open anyway... but not in this case.
  2. Batch jobs hold up the install process. You must keep you computer running all night waiting for the install to finish and before you can configure your modules or do anything else... unless you open another browser window and go

Queue is native in Drupal 7 and a dependency check in Drupal 6 isn't a horrible waist of processing time... if Drupal Queue doesn't exist... well move back to the batch way of doing things...

Comments

generalredneck’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes

Ok this has become higher priority because of the following:

in #2707123: entity_load to load all entities at once causing module to be unusable on sites with large amount of entities of type being loaded, rossb89 did a pretty damn good job making the module not be a memory hog by not loading entities all at once. However, we have a similar issue now with field items when there are a crap ton of them across any particular field. You can see that here

This has been noted in a really late comment by giuvax over in #1995022-10: Error while rebuilding views natural sort index - AJAX error; Column not found - Unknown column 'eid' in 'where clause', stating:

[21-Dec-2016 17:39:12 Europe/Rome] PHP Fatal error:  Allowed memory size of
268435456 bytes exhausted (tried to allocate 72 bytes) in
/home/qcfilmtv/public_html/redazione/sites/all/modules/views_natural_sort/views_natural_sort_text_field.module
on line 97

We should provide a queue module developers can add items to instead expecting them to return all their entries back via an array. Then we need to upgrade the batch processes to run the queue instead of expecting all the information up front. We probably should look to Queue UI for guidance on this as the whole purpose of that module is to run a queue in a batch process...

  • generalredneck committed 2444865 on 7.x-2.x
    Issue #1850224: As a user I would like to allow the use of a queue for...
generalredneck’s picture

Status: Active » Needs review

Ok. So looks like I've got a fix that needs testing in 7.x-2.x-dev. Give it a shot and see if it solves the needs of those who run out of memory. Technically you can use drush here as well by doing drush queue-run views_natural_sort_index_queue. This is because I implemented this as a cron queue (that doesn't run on cron btw).

generalredneck’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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