You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "tballison (via GitHub)" <gi...@apache.org> on 2026/08/27 12:41:32 UTC
[PR] TIKA-4846 -- add jsonl reporter [tika]
tballison opened a new pull request, #3082:
URL: https://github.com/apache/tika/pull/3082
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Thanks for your contribution to [Apache Tika](https://tika.apache.org/)! Your help is appreciated!
Before opening the pull request, please verify that
* there is an open issue on the [Tika issue tracker](https://issues.apache.org/jira/projects/TIKA) which describes the problem or the improvement. We cannot accept pull requests without an issue because the change wouldn't be listed in the release notes.
* the issue ID (`TIKA-XXXX`)
- is referenced in the title of the pull request
- and placed in front of your commit messages surrounded by square brackets (`[TIKA-XXXX] Issue or pull request title`)
* commits are squashed into a single one (or few commits for larger changes)
* Tika is successfully built and unit tests pass by running `./mvnw clean test`
* there should be no conflicts when merging the pull request branch into the *recent* `main` branch. If there are conflicts, please try to rebase the pull request branch on top of a freshly pulled `main` branch
* if you add new module that downstream users will depend upon add it to relevant group in `tika-bom/pom.xml`.
We will be able to faster integrate your pull request if these conditions are met. If you have any questions how to fix your problem or about using Tika in general, please sign up for the [Tika mailing list](http://tika.apache.org/mail-lists.html). Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4846 -- add jsonl reporter [tika]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #3082:
URL: https://github.com/apache/tika/pull/3082#discussion_r3874551565
##########
tika-pipes/tika-pipes-plugins/tika-pipes-file-system/src/test/java/org/apache/tika/pipes/fs/ConfigExamplesTest.java:
##########
@@ -42,4 +54,31 @@ public void testFileSystemEmitterConfig() throws Exception {
public void testFileSystemPipelineConfig() throws Exception {
loadAndValidate("file-system-pipeline.json");
}
+
+ @Test
+ public void testFileSystemJsonlReporterConfig() throws Exception {
+ loadAndValidate("file-system-jsonl-reporter.json");
+
+ JsonNode inner = innerComponent(readExample("file-system-jsonl-reporter.json"),
+ "pipes-reporters", null, "file-system-jsonl-reporter");
+ FileSystemJsonlReporterConfig config = FileSystemJsonlReporterConfig.load(inner.toString());
+ assertEquals("/var/log/tika/pipes-audit.jsonl", config.path().toString());
Review Comment:
This assertion hard-codes the UNIX path string. On Windows, `Path.toString()` will likely render with backslashes (e.g., `\var\log\...`), making this test OS-dependent even though the example JSON is meant for documentation only. Normalize separators (or assert on the raw JSON string) to keep the test portable.
##########
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/async/AsyncProcessor.java:
##########
@@ -142,6 +145,9 @@ private AsyncProcessor(Path tikaConfigPath, PipesIterator pipesIterator,
checkActive();
} catch (InterruptedException e) {
return WATCHER_FUTURE_CODE;
+ } catch (RuntimeException e) {
+ // already latched in failure; rethrowing would make this future a second one
+ return WATCHER_FUTURE_CODE;
}
Review Comment:
The watcher thread catches *all* `RuntimeException`s from `checkActive()` and exits quietly. That will also swallow unexpected runtime failures (e.g., an IllegalArgumentException for an unknown future code), making the processor continue without its watcher and hiding the root cause. Only suppress the RuntimeException when the failure has already been latched; otherwise rethrow so the error is surfaced.
##########
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/async/AsyncProcessor.java:
##########
@@ -343,8 +351,10 @@ public synchronized boolean checkActive() throws InterruptedException {
throw new IllegalArgumentException("Don't recognize this future code: " + i);
}
} catch (ExecutionException e) {
- LOG.error("execution exception", e);
- this.pipesReporter.error(e);
+ if (failure.compareAndSet(null, e)) {
+ LOG.error("execution exception", e);
+ this.pipesReporter.error(e);
+ }
Review Comment:
If `pipesReporter.error(e)` throws, it will escape this catch block and mask the original `ExecutionException` from the worker/emitter. That makes diagnosing the real failure harder and is inconsistent with the later logic that avoids reporter exceptions masking the primary stop reason. Consider catching reporter RuntimeExceptions here and suppressing them onto the original `ExecutionException` before rethrowing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4846 -- add jsonl reporter [tika]
Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison merged PR #3082:
URL: https://github.com/apache/tika/pull/3082
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org