Uploaded image for project: 'Hue'
  1. Hue
  2. HUE-6730

[fb] Use SkipFile instead of StopUpload in case of exception during file upload

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.12.0
    • Fix Version/s: 4.0.0
    • Component/s: app.filebrowser
    • Labels:
      None

      Description

      Due to permission issue an exception is raised at this point:
      try:
      self._fs.check_access(destination, 'rw-')
      except WebHdfsException, e:
      LOG.exception(e)
      raise HDFSerror(_('User %s does not have permissions to write to path "%s".') % (request.user.username, destination))
      So at following lines the _activated is not set to true and
      self._file = HDFStemporaryUploadedFile(self.request, file_name, self._destination)
      153 LOG.debug('Upload attempt to %s' % (self._file.get_temp_path(),))
      154 self._activated = True
      155 self._starttime = time.time()
      156 except Exception, ex:
      157 LOG.error("Not using HDFS upload handler: %s" % (ex,))
      158 self.request.META['upload_failed'] = ex
      So the StopUpload() is raised when the receive_data_chunk() function getsw called:
      def receive_data_chunk(self, raw_data, start):
      if not self._activated:
      166 if self.request.META.get('PATH_INFO').startswith('/filebrowser') and self.request.META.get('PATH_INFO') != '/filebrowser/upload/archive':
      167 raise StopUpload()
      This causes the code in mutipartparser.py to go to the
      except StopUpload as e:
      236 if not e.connection_reset:
      237 exhaust(self._input_data)
      And the exhaust() is called , which never returns and keeps looping on the iterator.
      So the exception

      SkipFile() does the same job as StopUpload().

      Testing
      1. Login as 'abc' and open a folder for which abc has no write permission
      2. Upload a 500mb file
      3. CPU usage shouldn't go to 100% and you should see the error popup.

        Attachments

          Activity

            People

            • Assignee:
              krish Sai K Chirravuri
              Reporter:
              krish Sai K Chirravuri
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: