Hi,

I'm using Webform 7.x-4.0-beta3 on a site that's hosted on multiple web servers behind a load-balancer that share a database and files directory, but that have discrete temporary:// directories. When users go to download a file of submissions to a form, it's possible that the temporary export file is created on one server, but the request to download the export file gets routed to one of the other web servers, where it doesn't actually exist in the temporary:// directory.

I'd like to be able to configure the location where Webform writes its temporary export files so I can be sure that location is shared across all of the web servers. I'll be attaching a patch that does this.

Thanks for the webform module!
-G

Comments

gdl’s picture

Status: Active » Needs review
StatusFileSize
new2.97 KB

Here's the promised patch.

gdl’s picture

Issue summary: View changes
quicksketch’s picture

Hmm, I don't think this should need to be an option. Having separate temporary directories will cause more issues than just with Webform. It's common to upload a file to the temp directory on one request and then move it to its final location on the second request. I would suggest configuring your site to use a shared temp directory and have the directory cleaned up of stale files on cron jobs.

gdl’s picture

Status: Needs review » Closed (won't fix)

I've never run into problems with multiple web front-ends with individual, unshared temporary:// directories, except for the one described here, but I take your point.

Thanks for Webform!
-G

adammalone’s picture

Status: Closed (won't fix) » Needs review

I'm going to have to respectfully disagree here. Using the plupload module as a precedent, it allows the temporary directory to be configurable.

It'll be slower overall to share temporary directories over multiple webheads when there is some kind of networked filesystem doing the distribution. It's optimal to keep temporary:// local to each web for fast local transactions with the filesystem on the server.

By utilising shared filesystems for non-ephemeral file storage it allows each web to have access to the same resources (albeit requiring more CPU and time simply because over the fs wrapper). Ideally, we'd want to keep as much of temporary as possible local to each web with selected items shared (webform exports/plupload etc).

Most people won't need this changed, although those on HA infrastructure with >1 web will require this (or they'll have to pin / do something else inefficient). @Quicksketch, if possible can we reconsider this feature request since it'll have next to no effect for existing users yet those on HA infrastructure will reap the benefits by changing one variable.

The patch itself looks sound and I'd be happy to check/RTBC it if it's decided the feature request can continue.

raccer’s picture

@typhonius +1 Great summary!

See https://www.drupal.org/node/1782038

It seems we have a client on Pantheon who's running into this issue. I'm going to have him test this patch and we'll look forward to marking this RTBC.

danchadwick’s picture

Seems reasonable. I hate the duplication of defaults, but it's probably not worth addressing with cmi in d8. I'd like to see nested function calls tho. I can do it, or a tweaked patch would speed up the commit. :)

  • DanChadwick committed 46f0dec on 7.x-4.x
    Issue #2221651 by gdl: Added Make temporary export file path...
  • DanChadwick committed 549bb54 on 8.x-4.x
    Issue #2221651 by gdl: Added Make temporary export file path...
danchadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Status: Needs review » Fixed
StatusFileSize
new2.56 KB

I tweaked your patch by combining the redundant code into a trivial helper. I also do not variable_del the configuration. It seems to be the webform standard to only variable_del configuration variables that are set with the UI. The assumption is that the others are set in conf.

To set this, put the following in your settings.php:

$conf['webform_export_path'] = 'temporary://'; // Change to the parent directory you want

Committed to 7.x-4.x and 8.x.

Status: Fixed » Closed (fixed)

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

alberto56’s picture

This functionality seems to have been removed in #2830992: Create the Webform-8.x-5.x branch and grant @jrockowitz maintainer access so it does not seem to be available in 8.x-5.x.

jrockowitz’s picture

D8 is a completely new code base. Please create a new ticket to port this feature to D8.

alberto56’s picture

dasginganinja’s picture

I just wanted to put up a patch here for an old 7.x-3.x instance we had.