Skip to content

Commit d13373d

Browse files
committed
TIKA-4809: Remove vestigial -spawnChild-era CLI options and config fields
1 parent 75e59ee commit d13373d

6 files changed

Lines changed: 3 additions & 69 deletions

File tree

tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerConfig.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,7 @@ public class TikaServerConfig {
4040
public static final int DEFAULT_PORT = 9998;
4141
public static final String DEFAULT_HOST = "localhost";
4242
public static final Set<String> LOG_LEVELS = new HashSet<>(Arrays.asList("debug", "info"));
43-
/**
44-
* Number of milliseconds to wait for forked process to startup
45-
*/
46-
public static final long DEFAULT_FORKED_STARTUP_MILLIS = 120000;
4743
private static final Logger LOG = LoggerFactory.getLogger(TikaServerConfig.class);
48-
//used in fork mode -- restart after processing this many files
49-
private static final long DEFAULT_MAX_FILES = 100000;
5044
private static final int DEFAULT_DIGEST_MARK_LIMIT = 20 * 1024 * 1024;
5145
/**
5246
* Endpoints that expose the pipes/fetch machinery (process-isolated pipes
@@ -58,9 +52,6 @@ public class TikaServerConfig {
5852
*/
5953
private static final Set<String> ENDPOINTS_REQUIRING_PIPES =
6054
new HashSet<>(Arrays.asList("pipes", "async"));
61-
private static final List<String> ONLY_IN_FORK_MODE = Arrays.asList(
62-
new String[]{"maxFiles", "javaPath", "maxRestarts", "numRestarts", "forkedStatusFile", "maxForkedStartupMillis",
63-
"tmpFilePrefix"});
6455
private static Pattern SYS_PROPS = Pattern.compile("\\$\\{sys:([-_0-9A-Za-z]+)\\}");
6556
/*
6657
TODO: integrate these settings:

tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ private static Options getOptions() {
113113
options.addOption("a", "pluginsConfig", true, "Tika Configuration json for pluginscomponents");
114114
options.addOption("i", "id", true, "id to use for server in server status endpoint");
115115
options.addOption("?", "help", false, "this help message");
116-
options.addOption("noFork", "noFork", false, "if launched in no fork mode");
117-
options.addOption("forkedStatusFile", true,
118-
"Not allowed in -noFork: temporary file used to communicate " + "with forking process -- do not use this! " + "Should only be invoked by forking process.");
119-
options.addOption("tmpFilePrefix", true, "Not allowed in -noFork: prefix for temp file - for debugging only");
120-
options.addOption("numRestarts", true, "Not allowed in -noFork: number of times that " + "the forked server has had to be restarted.");
121116
return options;
122117
}
123118

tika-server/tika-server-core/src/main/resources/tika-server-config-default.xml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,34 +47,9 @@
4747
<!-- whether or not to include the stacktrace when a parse exception happens
4848
in the data returned to the user -->
4949
<returnStackTrace>false</returnStackTrace>
50-
<!-- If set to 'true', this runs tika server "in process"
51-
in the legacy 1.x mode.
52-
This means that the server will be susceptible to infinite loops
53-
and crashes.
54-
If set to 'false', the server will spawn a forked
55-
process and restart the forked process on catastrophic failures
56-
(this was called -spawnChild mode in 1.x).
57-
nofork=false is the default in 2.x
58-
-->
59-
<noFork>false</noFork>
60-
<!-- maximum amount of time to wait for a forked process to
61-
start up.
62-
Not allowed if nofork=true. -->
63-
<maxForkedStartupMillis>120000</maxForkedStartupMillis>
64-
<!-- maximum number of times to allow a specific forked process
65-
to be restarted.
66-
Not allowed if nofork=true. -->
67-
<maxRestarts>-1</maxRestarts>
68-
<!-- maximum files to parse per forked process before
69-
restarting the forked process to clear potential
70-
memory leaks.
71-
Not allowed if nofork=true. -->
72-
<maxFiles>100000</maxFiles>
73-
<!-- if you want to specify a specific javaPath for
74-
the forked process. This should be the full path
75-
including the executable, e.g.: /usr/bin/java
76-
Not allowed if nofork=true. -->
77-
<javaPath>java</javaPath>
50+
<!-- Per-document process isolation, crash restart, and timeouts are
51+
configured via the pipes section (pipes.forkedJvmArgs,
52+
pipes.numClients) and parse-context.timeout-limits, not here. -->
7853
</params>
7954
</server>
8055
</properties>

tika-server/tika-server-core/src/test/resources/configs/tika-config-timeout-100ms.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

tika-server/tika-server-core/src/test/resources/configs/tika-config-with-timeout.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/TikaResourceTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public class TikaResourceTest extends CXFTestBase {
6262
public static final String TEST_DOC = "test-documents/test.doc";
6363
public static final String TEST_PASSWORD_PROTECTED = "test-documents/password.xls";
6464
private static final String TEST_RECURSIVE_DOC = "test-documents/test_recursive_embedded.docx";
65-
private static final String TEST_OOM = "mock/fake_oom.xml";
6665

6766
private static final String TIKA_PATH = "/tika";
6867
private static final int UNPROCESSEABLE = 422;

0 commit comments

Comments
 (0)