Add missed standard types during batch's size estimation - #19158
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label. Could you fix it @andsel? 🙏
|
f18db90 to
dd45906
Compare
…ered the log level when an error reach the outer batch estimation method
…possible else throw an error
dd45906 to
11ed019
Compare
There was a problem hiding this comment.
Pull request overview
Fixes noisy error logging during pipeline batch-size estimation (issue #19066) caused by org.logstash.Timestamp values not being recognized by ConvertedMap.estimateMemory. Adds an explicit Timestamp branch, a Java-serialization fallback for unknown-but-Serializable types, threads a field path through the recursion to make diagnostic messages actionable, and downgrades the batch-metrics failure log from error to warn.
Changes:
- Add a
Timestampbranch and a Serializable fallback toConvertedMap.estimateMemory, with field-path-enriched diagnostics. - Thread
fieldPaththrough the recursiveestimateMemorycalls and updateEvent.estimateMemoryto seed<data>/<meta>roots. - Downgrade the metric-failure log severity in
QueueReadClientBatchMetricsand add unit/integration tests inConvertedMapTestandEventTest.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| logstash-core/src/main/java/org/logstash/ConvertedMap.java | Adds Timestamp branch, Serializable fallback, and field-path-aware recursion (private signature changed to (String, Object)). |
| logstash-core/src/main/java/org/logstash/Event.java | Passes <data> / <meta> root field paths into ConvertedMap.estimateMemory. |
| logstash-core/src/main/java/org/logstash/execution/QueueReadClientBatchMetrics.java | Downgrades the catch-all log from error to warn. |
| logstash-core/src/test/java/org/logstash/ConvertedMapTest.java | Adds tests using ListAppender to cover serializable and non-serializable unknown types. |
| logstash-core/src/test/java/org/logstash/EventTest.java | Adds roundtrip estimateMemory test for nested Timestamp field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Tested with the pipeline configuration in the comments of the linked issue and confirm I don't see the error and see the successful log lines estimating the batch metrics estimated memory consumption: |
💛 Build succeeded, but was flaky
Failed CI StepsHistory
cc @andsel |
|
@Mergifyio backport 9.4 |
✅ Backports have been createdDetails
|
… estimation Fixed error during event size estimation on non recognised types. - Handle the missed `Timestamp` branch during the estimation. - Adds a couple of safe guards during estimation 1. if class is not belonging to the list of supported in Valufier (which should be a programming error) but it's serializable, use Java serialization 2. if such class is neither serilizable log a warning error - Updates the BigDecimal estimation considering the inner BigInteger instance The safeguards log messages contains also the field path to the offending field. (cherry picked from commit 0b09a83) Co-authored-by: Andrea Selva <selva.andre@gmail.com>
… estimation (#19179) * Add missed standard types during batch's size estimation (#19158) Fixed error during event size estimation on non recognised types. - Handle the missed `Timestamp` branch during the estimation. - Adds a couple of safe guards during estimation 1. if class is not belonging to the list of supported in Valufier (which should be a programming error) but it's serializable, use Java serialization 2. if such class is neither serilizable log a warning error - Updates the BigDecimal estimation considering the inner BigInteger instance The safeguards log messages contains also the field path to the offending field. (cherry picked from commit 0b09a83) # Conflicts: # logstash-core/src/main/java/org/logstash/ConvertedMap.java * [git conflict] Fixed * Fixed API invocation, instead of use JRuby 10.0 use the 9.4 version --------- Co-authored-by: Andrea Selva <selva.andre@gmail.com>
Release notes
Fixed error during event size estimation on non recognised types.
What does this PR do?
Timestampbranch during the estimation.The safeguards log messages contains also the field path to the offending field.
Why is it important/What is the impact to the user?
Avoid to log error messages where the user can't take any action to solve and that doesn't impact event processing but just the size calculation.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
Test with the pipeline-to-pipeline as described in reproducer comment.
Related issues