mbalassi opened a new pull request, #1194:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1194
JobStatusObserver capped JobManager exception text in K8s events byline
count (stacktrace.split("\n"), keep first N lines). A single unbroken line of
any size produces one array element, so it bypassed the cap entirely and could
fill the operator heap.
# Approach
- Replaced `events.exceptions.stacktrace-lines` (line count, default 5)
with `events.exceptions.stacktrace.max.length` (character count, default
2048 — matches the two existing sibling options
`exception.stacktrace.max.length` / `exception.field.max.length`; no
config in the repo defaults to 4096, so 2048 was kept rather than
raised).
- Replaced the truncation itself: stacktrace.length() >
maxStackTraceLength + bounded substring, instead of splitting on \n.
Also removes an unbounded 3-4x string-copy chain downstream of the old
cap.
- Old option removed outright (no value-preserving migration exists
between line-count and character-count semantics).
- Added a regression test (5000-char single line, no newlines) and
updated existing tests, generated config docs, and hand-written
event-format docs (both locales).
# Testing
Updated existing unit test and added a new test to explicitly cover the bug
scenario reported in FlINK-40452.
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR,
please
change the checkbox below to `[X]` followed by the name of the tool, and
uncomment the
"Generated-by" line. See the ASF Generative Tooling Guidance for details:
https://www.apache.org/legal/generative-tooling.html
You are responsible for the quality and correctness of every change in this
PR
regardless of the tooling used. Low-effort AI-generated PRs will be closed.
See
AGENTS.md for the full guidance.
-->
- [ X ] Yes (please specify the tool below)
Generated-by: Claude Code (Opus 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]