Commit b9df9be
fix(mediafilter): log unparsable-PDF filter-media errors as WARN, not ERROR
A corrupt/malformed source PDF made PDFBoxThumbnail and TikaTextExtractionFilter
let a parse IOException escape, which MediaFilterServiceImpl re-logged at ERROR --
flooding the nightly filter-media job (~4,655 ERROR lines/night) and tripping
alerting, even though the job already skips the file and continues.
Reimplemented for dtq-dev (PDFBox 3 / Loader.loadPDF; the TUL PDFBox-2 diff does
not apply as-is):
- PDFBoxThumbnail: catch the parse IOException, log WARN, return null (skip).
- TikaTextExtractionFilter: read the bitstream into memory first so a genuine
assetstore read failure still propagates, then catch IOException/TikaException
from the in-memory parse only -> WARN + return null. This narrows the catch so
real I/O errors are not swallowed (the TUL Tika variant caught all IOException).
Port of dataquest-dev/dspace-customers#903 (item 4). Source: customer/TUL 7035a4c (reimplemented).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 6114281 commit b9df9be
2 files changed
Lines changed: 20 additions & 6 deletions
File tree
- dspace-api/src/main/java/org/dspace/app/mediafilter
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
0 commit comments