spuru9 opened a new pull request, #1260:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1260

   ## What is the purpose of the change
   
   This takes over #1194 from @mbalassi, which has had no activity since 
August. It is rebased on `main` and addresses the open review comments.
   
   `JobStatusObserver` limited JobManager exception text in Kubernetes events 
by line count, so a single line of any size was not truncated at all and could 
fill the operator heap.
   
   ## Brief change log
   
   - Márton's commit, rebased: add 
`kubernetes.operator.events.exceptions.stacktrace.max.length` (default 2048) 
and truncate the `JobException` stack trace by characters. Its `events.md` hunk 
was dropped because `main` no longer has that section.
   - `events.exceptions.stacktrace-lines` shipped in 1.12.0, so it is 
deprecated instead of removed. It no longer has a default, and when set it is 
applied in addition to the character limit.
   - A negative max length disables the limit. Before, it threw 
`IndexOutOfBoundsException`, so no event was emitted and the same history was 
retried on every observe.
   - The `Error` event of a failed job (`recordJobErrorIfPresent`) is truncated 
with the same limit.
   - The REST call requests at most `limit-per-reconciliation + 1` exceptions 
through `maxExceptions` (supported since Flink 1.10) instead of the JobManager 
default of 20. This resolves the TODO in `observeJobManagerExceptions`.
   
   Behaviour change: by default, `JobException` events now contain up to 2048 
characters instead of 5 lines.
   
   ## Verifying this change
   
   - `JobStatusObserverTest`: a single 5000-character line, a negative limit 
(the full text is emitted and the timestamp advances), the deprecated line 
option, `Error` event truncation, and edge cases of `truncateExceptionText`. 
The three observer tests fail without the fix.
   - `AbstractFlinkServiceTest#getJobExceptionsRequestsAtMostMaxExceptions`, 
and `testExceptionLimitConfig` now asserts that the observer requests the limit 
+ 1.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API, i.e., is any changes to the `CustomResourceDescriptors`: no
   - Core observer or reconciler logic that is regularly executed: yes, the 
exception events in `JobStatusObserver`
   
   ## Documentation
   
   - Does this pull request introduce a new feature? yes, a new config option
   - If yes, how is the feature documented? docs (generated config reference 
and `operations/events.md`)
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (Claude Code, Claude Opus 5.5)
   
   Generated-by: Claude Code (Claude Opus 5.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]

Reply via email to