Item11115: handler to tmp location of uploads is kept open

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: FoswikiUIUpload
Branches:
Reported By: AndreLichtsteiner
Waiting For: AndreLichtsteiner
Last Change By: AndreLichtsteiner
We observerd, that file handler to the temporary files of attachment uploads don't get closed. This is not a desired behaviour when foswiki runs in fastcgi.

-- AndreLichtsteiner - 06 Sep 2011

This appears to be a default behavior of CGI. From the module:

    # Set this to 1 to cause files uploaded in multipart documents
    # to be closed, instead of caching the file handle
    # or:
    #    1) use CGI qw(:close_upload_files)
    #    2) $CGI::close_upload_files(1);
    # Uploads with many files run out of file handles.
    # Also, for performance, since the file is already on disk,
    # it can just be renamed, instead of read and written.
    $CLOSE_UPLOAD_FILES = 0;

Adding the call $query->close_upload_files(1); in Upload.pm after the stream is closed appears to resolve the issue. Making this the default behavior by setting it in Request.pm however breaks upload, as every upload is reported as "empty"

-- GeorgeClark - 06 Sep 2011

Never mind. Does not fix issue, and does not appear to be related.

-- GeorgeClark - 06 Sep 2011

There are major changes in CGI 4.05+ in it's tempfile handling. This needs further validation on 1.2 with latest CGI.

-- GeorgeClark - 23 Dec 2014

I think that this is a duplicate of Item10428. we are not seeing this issue on foswiki.org. AndreLichtsteiner, have you by any chance updated to later CGI or foswiki, and is this still an issue?

-- GeorgeClark - 15 Jun 2015

Yeah, I thing the issue is resolved.

-- Main.AndreLichtsteiner - 30 Jan 2016 - 10:50

 

ItemTemplate edit

Summary handler to tmp location of uploads is kept open
ReportedBy AndreLichtsteiner
Codebase 1.1.3
SVN Range
AppliesTo Engine
Component FoswikiUIUpload
Priority Normal
CurrentState Closed
WaitingFor AndreLichtsteiner
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x00Checkins
Release01x01Checkins
Topic revision: r7 - 30 Jan 2016, AndreLichtsteiner
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy