Add CapnProto message size limit#91888
Merged
antonio2368 merged 4 commits intomasterfrom Dec 12, 2025
Merged
Conversation
355c608 to
74bc682
Compare
Contributor
|
Workflow [PR], commit [28f472b] Summary: ❌
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a configurable size limit for CapnProto messages to prevent excessive memory allocation from malformed or corrupted data. The default limit is set to 1 GiB.
Key Changes:
- Introduces a new setting
format_capn_proto_max_message_sizewith a default value of 1 GiB - Implements message size validation in the CapnProto input format reader
- Adds a test case to verify the size limit enforcement
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/FormatFactorySettings.h | Declares the new format_capn_proto_max_message_size setting |
| src/Formats/FormatSettings.h | Adds the max_message_size field to CapnProto format settings with 1 GiB default |
| src/Formats/FormatFactory.cpp | Wires the new setting into the format settings initialization |
| src/Processors/Formats/Impl/CapnProtoRowInputFormat.h | Adds max_message_size member variable to store the limit |
| src/Processors/Formats/Impl/CapnProtoRowInputFormat.cpp | Implements the message size check and throws an error when exceeded |
| src/Core/SettingsChangesHistory.cpp | Records the new setting in version 25.12 settings history |
| tests/queries/0_stateless/03756_capn_proto_message_size_limit.sql | Adds test case for the size limit enforcement |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Avogar
approved these changes
Dec 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add CapnProto message size limit. It can be changed with
format_capn_proto_max_message_size.Close #90298
Documentation entry for user-facing changes