Repository navigation
Attachment node and processor cap settings - #148493
Conversation
|
Hi @kingherc, I've created a changelog YAML for you. |
🔍 Preview links for changed docs |
✅ Vale Linting ResultsNo issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
3609f6f to
995276e
Compare
995276e to
0170f78
Compare
There was a problem hiding this comment.
Pull request overview
Adds configurable limits to the ingest attachment processor to cap decoded attachment payload size before handing bytes to Tika, via both a per-processor option and an optional node-level default, with accompanying tests and changelog/docs updates.
Changes:
- Add
max_attachment_bytesprocessor option and enforce decoded-input size limits inAttachmentProcessor. - Introduce
ingest.attachment.max_attachment_sizenode setting (relative/absolute) and wire settings through the plugin/factory. - Add REST/YAML and unit tests for rejection behavior and on-failure handling; update module test cluster dependencies.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/20_max_input_bytes.yml | New REST tests covering max decoded input size behavior and on-failure. |
| modules/ingest-attachment/src/yamlRestTest/java/org/elasticsearch/ingest/attachment/IngestAttachmentClientYamlTestSuiteIT.java | Test cluster now includes ingest-common for set processor usage in on_failure. |
| modules/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java | Unit tests for per-processor and node-level caps (absolute/ratio). |
| modules/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorFactoryTests.java | Factory tests updated for node settings and invalid max_attachment_bytes. |
| modules/ingest-attachment/src/main/resources/META-INF/services/org.elasticsearch.features.FeatureSpecification | Registers ingest-attachment feature specification for tests. |
| modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/IngestAttachmentPluginFeatures.java | Defines the attachment max-size cluster feature for test gating. |
| modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/IngestAttachmentPlugin.java | Registers the new node setting and passes node settings to the processor factory. |
| modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/AttachmentProcessor.java | Implements node setting, processor option parsing, and decoded-size enforcement. |
| modules/ingest-attachment/build.gradle | Adds ingest-common to cluster modules for YAML REST tests. |
| docs/reference/enrich-processor/attachment.md | Documents the new max_attachment_bytes processor option. |
| docs/changelog/148493.yaml | Adds changelog entry for processor option + node setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
50c018a to
51fbfe0
Compare
9ec81f8 to
75cd22e
Compare
d8b288d to
738e19f
Compare
738e19f to
24582b7
Compare
24582b7 to
c44c883
Compare
marciw
left a comment
There was a problem hiding this comment.
Small edits to the associated docs changes.
Co-authored-by: Marci W <333176+marciw@users.noreply.github.com>
Co-authored-by: Marci W <333176+marciw@users.noreply.github.com>
|
Gentle reminder for reviews. Actually I just realized that for our sake, I could just introduce the node setting and no processor setting. However, since I've developed it, I leave it in here and welcome your comments on whether it'd be useful or not to introduce; else I can remove the per-processor setting. cc @jimczi , @tballison , @masseyke |
marciw
left a comment
There was a problem hiding this comment.
a few more docs tweaks. Am also going to push a commit to update the elasticsearch settings reference.
Nope, I'll do that in a separate PR so I can unblock you. 👍 |
Co-authored-by: Marci W <333176+marciw@users.noreply.github.com>
|
Thank you all! I have the necessary approvals to merge this. So, any last reviewer that would like to pitch in comments or feedback, please do so quickly. Even if it's just to tell me to wait before merging these.
Thanks @marciw , may I ask where (in which repos and files) you do that? Just for my knowledge, because I have in my PR description the following:
And I'm unaware whether I should do them, or they'd be automatically done by someone/something retroactively. |
just updating the configuration reference
The first one (extending Processors.ts) is a task for you :) and the spec needs to be updated before the java client is regenerated. For the second, I don't know all the details, but here's a recent java client PR for reference: elastic/elasticsearch-java#1236 |
|
@marciw This is merged, feel free to update the elasticsearch settings reference. Note that I'd recommend not documenting the |
Processor setting to cap decoded attachment input before Tika. Optional node-level cap setting as well. Both default to unset, for backwards compatibility.
Also introduces metrics for attachment raw sizes before the cap check and for attachments that complete processing.
TODOs after this PR is merged:
it is not done automatically.
Relates #97819