← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1433765] Re: FileField need clean up temp file and and get file size without loading file

 

Yes, I can confirm problem.

I use both service in workable state: glance and horizon (via apache 2.4
wsgi)

local_settings.py has variable for storing big file for uploading in
django level - FILE_UPLOAD_TEMP_DIR = '/opt/openstack/tmp'

In web interface, in section of uploading images, I am doing uploading of image file on 500Mb (raw format) , process is going without problem.   WSGI process is making upload of this file in temporary directory and after this putting of image into 'glance'.
It is OK.  User is log out from web interface. 
Image in glance backend, but in temporary directory I see this temporary file. 
'
total 578196
-rw------- 1 homitaka homitaka 592066560 Nov 15 18:19 tmpO4djfP.upload

'

It is real bug and problem.  After few uploading I lost 2-3 Gbyte of
space. Rebooting of httpd server - file still in tmp.  Could you say,
where in code of interaction between wsgi process and service of glance
need to insert code for removing this file, after creating of image?

** Changed in: horizon
       Status: Invalid => Confirmed

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1433765

Title:
  FileField need clean up temp file and and get file size without
  loading file

Status in OpenStack Dashboard (Horizon):
  Confirmed

Bug description:
  
  We are using forms.FileField to upload a client local file. 

  We noticed that if the file size is big, for example 7 gb,  Horizon
  dumps a temp file in /tmp dir where horizon server runs. If the file
  loaded is different each time, the temp files are left in the /tmp.
  Over the long run, it could overflow the disk spaces.

  We would like to have a way to clean up the tmp file once file loading
  is done.

  The way that we use to get the file handle  in the form's clean or
  handle method is :

  f = self.request.FILES['file"]

  If we use this to get the file size in the clean method to validate,
  the whole file gets loaded either into memory or to temp dir,  it
  would be nice to get the file size without loading the whole file.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1433765/+subscriptions


References