[
https://issues.apache.org/jira/browse/TIKA-4886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113412#comment-18113412
]
ASF GitHub Bot commented on TIKA-4886:
--------------------------------------
tballison commented on PR #3149:
URL: https://github.com/apache/tika/pull/3149#issuecomment-5604373164
From my bot (that I agree with).
```
- The Path overload. execute(ProcessBuilder, ParseContext, long, Path,
int) at line 250 has the identical grantedTimeoutMillis computation and still
spawns. Same helper,
same if, plus the same three-line test.
- Result fields on the fast path. stdoutLength, stderrLength and
processTimeMillis stay at their -1 defaults where the spawn path reports 0.
ExternalParser, GDAL, Siegfried
and Magika copy them into metadata. Set them to 0.
```
> ProcessUtils spawns and immediately kills a subprocess when time budget is
> zero
> -------------------------------------------------------------------------------
>
> Key: TIKA-4886
> URL: https://issues.apache.org/jira/browse/TIKA-4886
> Project: Tika
> Issue Type: Bug
> Components: core
> Reporter: Tim Grein
> Priority: Minor
>
> Currently ProcessUtils.execute starts a subprocess, even if
> requestedTimeoutMillis is 0. TikaHttpClient on the other hand has a fail fast
> path, where a timeout exception is thrown, if the granted timeout is <= 0.
> ProcessUtils.execute should probably also have a fail fast path similar to
> the TikaHttpClient.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)