You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Darren Cooper (Jira)" <ji...@apache.org> on 2020/10/09 20:39:00 UTC
[jira] [Created] (TIKA-3208) tika-server Detect when using fileUrl
header does not close the file handle
Darren Cooper created TIKA-3208:
-----------------------------------
Summary: tika-server Detect when using fileUrl header does not close the file handle
Key: TIKA-3208
URL: https://issues.apache.org/jira/browse/TIKA-3208
Project: Tika
Issue Type: Bug
Components: server
Affects Versions: 1.24.1, 1.24, 1.23
Environment: Centos 7
java 1.8
Reporter: Darren Cooper
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)