Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Since I've a somewhat bigger field export, it happens that the field-rebuild runs into a timeout on installation.
The default of Drupal is 240. The attached patch changes the function field_features_export_render
and adds a line with drupal_set_time_limit(3600);
to the export output.
That should work for now, but if other rebuild functions, besides fields, also run into timeouts we should think about to increase the time limit somewhere more central in features.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1053608-features_rebuild-4.patch | 651 bytes | hefox |
#4 | features-rebuild-time-limit-1053608-4.patch | 426 bytes | nedjo |
features-increase-time-limit-on-fields-import.patch | 509 bytes | das-peter | |
Comments
Comment #1
irakli CreditAttribution: irakli commentedI am worried about brute-force increase of time limit. I think we should be using batch api if this operation typically takes this much time.
Comment #2
mpotter CreditAttribution: mpotter commentedClosing this for lack of activity. Please re-open this issue if you can reproduce it in the latest version.
Comment #3
nedjoA batch-based solution is here, #1572578: Rethink the way features are enabled / disabled, and likely is the best solution here. However, meantime, feature rebuilding is a common source of out of memory errors, especially at site install time if many features have been enabled, leading to all components of all enabled features being rebuilt in a single page load at first cache clear.
The standard Drupal core approach here is indeed to set the time limit, with 240 being the standard value used.
Comment #4
nedjoPatch adding a drupal_set_time_limit() call to features_rebuild(). This is parallel to what's done in e.g. _locale_import_po().
Comment #5
hefox CreditAttribution: hefox commentedI'm not a fan of randomly setting a new time limit, or changing it unless really needed, so here's a version with a variable that can be set via $conf in settings.php or such
Comment #6
mpotter CreditAttribution: mpotter commentedI like the approach in #5. Might need another issue to add this to the documentation. Code committed to 09fc928.