Though Views Data Export uses batch operation to break up larger data sets to avoid timeouts, the batching doesn't avoid timeouts with this module for large (100+ page) exports since PDF creation with wkhtmltopdf happens all in one shot at the end of the export process. It would be great if this module optionally could integrate with a module like Background Process, to give site builders an easy way to avoid timeouts when wkhtmltopdf takes 90+ seconds to generate a PDF.

(I picked 90 seconds because that's the timeout on Pantheon).

I don't think that Background Process should be a hard dependency/mandatory, since that module is not well-maintained and might cause problems for some sites, but I do think it's the best option available to off-load large exports to a background task/sub-request.

Comments

GuyPaddock created an issue. See original summary.

  • d5c2054 committed on 7.x-1.x
    #3114698 - Implement Pluggable Renderers + Background Process Rendering...
guypaddock’s picture

This feature has now been committed to dev.

The changes for this feature make it possible for new ways of rendering PDFs to be exposed by modules via hook_pdf_export_renderers(). Right now, only "VDE PDF" and the new "VDE PDF Background Process" module implement the hook.

This also adds a new "Renderer" option to the VDE PDF style settings form, to allow a renderer to be chosen. The default renderer is "In proc" which behaves the same as logic before this change -- it invokes wkhtmltopdf within the request thread and blocks the request until the PDF has been generated.

Once the "Views Data Export PDF Background Process" module has been enabled, a new renderer option called "Background process" appears. When selected, for batched exports, wkhtmltopdf is invoked by an asynchronous background sub-request that is polled periodically by the batch requests. This ensures that large PDFs don't cause a timeout during a batched export. This renderer has no effect on un-batched exports -- they still necessarily have to generate the PDF within the same request as the export.

So, existing users of this module don't need to install Background Process but those who do can take advantage of the new renderer.

guypaddock’s picture

Assigned: guypaddock » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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