Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-8396

(7.0.z) UNDERTOW-961 - File descriptors leak in MultiPartParserDefinition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.5.CR1, 7.0.5.GA
    • 7.0.4.GA
    • Undertow
    • None
    • Low
    • Hide

      Deploy application, that can receive file uploads and upload many files with size that exceeds limit. Default limit is 10Mb. Exception is thrown:
      java.io.IOException: UT000054: The maximum size 10485760 for an individual file in a multipart request was exceeded
      at io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.data(MultiPartParserDefinition.java:266)
      at io.undertow.util.MultipartParser$IdentityEncoding.handle(MultipartParser.java:332)

      Show
      Deploy application, that can receive file uploads and upload many files with size that exceeds limit. Default limit is 10Mb. Exception is thrown: java.io.IOException: UT000054: The maximum size 10485760 for an individual file in a multipart request was exceeded at io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.data(MultiPartParserDefinition.java:266) at io.undertow.util.MultipartParser$IdentityEncoding.handle(MultipartParser.java:332)
    • EAP 7.0.5

      If some exception is thrown while uploading file (for example, file size limit exceeded), then file deleted, but file channel is not closed. Linux lsof command shown a growing number of descriptors. I solved this problem by modifying io.undertow.server.handlers.form.MultiPartParserDefinition$MultiPartUploadHandler.parseBlocking()
      exchange.putAttachment(FORM_DATA, data);
      } catch (IOException e) {
      try {
      if (fileChannel != null)

      { fileChannel.close(); }

      } catch (Throwable ignored) {
      }
      throw e;
      }
      Added fileChannel.close(). May be, this code need to be moved in MultiPartUploadHandler.close()

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              sdouglas1@redhat.com Stuart Douglas (Inactive)
              Radim Hatlapatka Radim Hatlapatka (Inactive)
              Radim Hatlapatka Radim Hatlapatka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: