Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-1936 Clean up parsers not cleaning up resources
  3. TIKA-1929

Need to close resources on exception in sqlite parser

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      If there's an exception during parsing of a SQLite file, we aren't guaranteeing that the temp file is deleted.
      If a TikaInputStream is used, we assume the calling code will close the stream and thereby delete the temp file. However, if another type of InputStream is used, we copy that to a temp file, and we need to ensure that we delete that temp file if there's an exception during the parse.

      While we're at it, we should also clean up test code to close streams correctly.

      Unrelated to this issue... I noticed that xerial's SQLite code is still leaving behind a copy of the native dll in the temp folder on Windows the first time the SQLite parser is called. See https://github.com/xerial/sqlite-jdbc/issues/80.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tallison Tim Allison
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment