Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-3208

tika-server Detect when using fileUrl header does not close the file handle

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.23, 1.24, 1.24.1
    • Fix Version/s: 1.25
    • Component/s: server
    • Labels:
      None
    • Environment:

      Centos 7

      java 1.8

       

      Description

      When using the fileUrl header to detect a file on localdisk the java process does not release the file handle.

      When the detected file is deleted, the disk space is not released because of the open file handle.

      Test

      curl -X PUT -H "fileUrl: file:///root/test.pdf" http://localhost:9998/detect/stream

      rm /root/test.pdf

      lsof of (pid of java tika-server)--

      file handle open to /root/test.pdf (deleted)

       

      As a test fix tika-server/src/main/java/org/apache/tika/server/resource/DetectorResource.java was modified to add

      try

      { tis.close(); }

      catch (Exception e) {}

       

      to the finally blcok in public detect and the problem seemed to be resolved.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              darren.cooper Darren Cooper
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified