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

Details

    • Bug
    • Resolution: Done
    • 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

    Description

      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()

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: