Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2329

NPE at org.zkoss.zk.au.http.AuUploader.service(AuUploader.java:115)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.7, 8.0.1
    • 6.5.0, 7.0.2, Freshly, 7.0.6.1
    • None
    • None

      This looks like a race condition from uploading a file while the server is
      on heavy load.
      From what I understand, there were 3 different
      requests sent to the server while uploading the file.

      a) Send content to server
      b) Send status information -> determine upload progress
      c) Send onUpload event when upload has finished

      An ItemFactory will be initiated upon a). In
      AuUploader attributes "Attributes.UPLOAD_PERCENT" and
      "Attributes.UPLOAD_SIZE" are set at line 515 - 518. If the requests for status
      information are processed before these attributes are set (which
      happens from time to time on our server) an exception is triggered at
      line 115 because "size" is null. What is more, there is another potential
      problem with exception handling in line 177 as there is a check on whether
      "percent != null". If the CPU switches from thread (request) in step
      a) in line 516 to thread (request) in step b) only "percent" is !=
      null and "size == null". That means an exception occurred outside the
      try-catch-block.

      This usually results in a failed upload.

      Regards salbader

            jumperchen jumperchen
            salbader salbader
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h