Conversation
|
Thanks. I have identified some things, will push directly here and run some test swith my sc-warc-demo ;-) - moving to draft now. |
|
Thanks @tballison, this works nicely. I pushed a commit on top with a few fixes:
I tested it on a Storm 3.1.0 cluster in Docker. Timeouts, an OOM in the fork (reported as One thing for the Tika side: with |
|
Please don't merge until I have a chance to take a look today and respond to your observations. Not sure if it is worth converting to draft? |
|
@tballison I did change it to draft ;-) - I did tests with my local storm docker environment, which where fine (also with your 6kb parser explosion). But we are not in a hurry - please also check and once you think it is fine, go back to ready state (and merge if you feel alike). |
|
Where are you on sizing etc? How many threads go through a bolt? How do we advise users on numConsumers and -Xmx for forked parsers? |
|
@tballison Good questions. In Storm every bolt executor is a single thread and For memory, I'd tell users to always set One thing I noticed while looking into this: if no heap is set, Tika gives each fork Also worth documenting: |
|
Had a look at what reaches the fork and what comes back. ConfigMerger drops setSocketTimeoutMillis and setJavaPath: the fork runs java from the PATH with a 60s socket timeout. parse.Content-Type is the raw server header, the tuple metadata overwrites what the fork parsed. The text comes back as one tk:content string reparsed as XML, up to 20M chars twice in the worker. Smaller things: the fork starts lazily, so a bad jvmarg makes every URL a parse pipes error; a one-line parse in prepare would fail the bolt instead. PARTIAL_TIMEOUT goes out as a trimmed success while the docs say ERROR, intended? maxfilesperprocess defaults to 10000 on the Tika side. On the heap I'd append -Xmx512m when there's no heap flag, Storm can't give a per-host split. |
|
Feel free to enhance it @dpol1 (directly in this branch - should be possible) |
|
https://issues.apache.org/jira/browse/TIKA-4932 Those are small enough to get into our 4.1.0 release. Fixing those now. rc2 should go under vote later today. Thank you @dpol1 ! |
…er.tika.timeout, via Tika Pipes
- strip the content the fork returns as metadata (tk:content), it was copied to parse.* for every document - keep the text and links of a trimmed fork output instead of failing the document on the XML cut off mid-document, and stop the fork at parser.tika.text.maxlength - one fork per bolt instance: execute() parses one document at a time, so drop parser.tika.pipes.numclients - start the fork with the worker's own java instead of the one on the PATH - exclude the log4j backend brought by tika-pipes-fork-parser, the Storm worker provides it - the fork always maps HTML with Tika's DefaultHtmlMapper, document it and only warn when another mapper is configured - delete the temporary Tika configuration right away when no fork needs it - plugins dir is not needed for documents over 10MB, fix the docs - tests for the metadata, a trimmed parse and a crashed fork
8d441fe to
1796bb3
Compare
Without a heap flag Tika gives each fork 60% of the RAM, whatever the number of ParserBolt executors on the host. Signed-off-by: Davide Polato <dpol1@apache.org>
A fork that cannot start, e.g. with a bad jvmarg, now fails the bolt instead of turning every URL into a parse pipes error. Signed-off-by: Davide Polato <dpol1@apache.org>
Signed-off-by: Davide Polato <dpol1@apache.org>
TimeoutLimits bounds the parse. From Tika 4.1 the socket timeout also shuts down an idle fork and must stay above the 1s heartbeat. Signed-off-by: Davide Polato <dpol1@apache.org>
99b2032 to
e876ecb
Compare
|
@tballison and @rzo1. had a look at the timeouts against Tika main: TimeoutLimits is what kills the parse, socketTimeoutMillis is only liveness and idle shutdown. with TIKA-4931 our setSocketTimeoutMillis(parseTimeout) starts to count, so 1s or less won't even start the fork and an idle fork exits after T. dropped it in the last commit, so we stay on Tika's 60s default, same as 4.0 today. ok with you? |
|
I think it is fine. Let's wait for Tika 4.1.0 and I guess we are fine. |
Right. |
Yes! |
|
@dpol1 please do share other, ahem, sharp edges. 🤣 |
This modernizes the calls to Tika to use tika-pipes. Parsing is done in a forked process to protect the jvm from timeouts and ooms.
This adds some challenges for provisioning -- number of forks and Xmx for each.
However, this now brings the use of Tika back into Tika's security model. Let me know what you think of my bot's work.
Review this carefully. It is 100% 🤖