Skip to content

Limit redisson batch command length#18744

Merged
trask merged 1 commit into
open-telemetry:mainfrom
laurit:redisson-limit
May 15, 2026
Merged

Limit redisson batch command length#18744
trask merged 1 commit into
open-telemetry:mainfrom
laurit:redisson-limit

Conversation

@laurit

@laurit laurit commented May 14, 2026

Copy link
Copy Markdown
Contributor

Hopefully resolves #9952

Copilot AI review requested due to automatic review settings May 14, 2026 14:25
@laurit
laurit requested a review from a team as a code owner May 14, 2026 14:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Limits the combined sanitized query text length in Redisson batch commands to prevent excessive memory consumption (and potential OOMs) when batches contain many or very large commands.

Changes:

  • Adds a 32 KiB cap on the cumulative sanitized text in RedissonRequest.sanitizeQuery(), breaking out of the loop once exceeded.
  • Adds a largeBatchCommand test that verifies only commands fitting under the limit are included in the db.statement attribute.
  • Fixes a typo ("loner" → "longer") in RedisCommandSanitizer's LIMIT comment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
instrumentation/redisson/redisson-common-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/common/v3_0/RedissonRequest.java Introduces a 32 KiB length limit while sanitizing batch commands.
instrumentation/redisson/redisson-common-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/AbstractRedissonClientTest.java Adds large-batch test; switches existing batch test from sorted to plain trace assertion.
instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/RedisCommandSanitizer.java Typo fix in comment.

@laurit laurit added this to the v2.28.0 milestone May 15, 2026
@trask
trask merged commit 3bcb7b9 into open-telemetry:main May 15, 2026
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in redisson instrumentation

3 participants