Skip to content

Conversation

@rionmonster
Copy link
Contributor

@rionmonster rionmonster commented Dec 6, 2025

Purpose

Linked issue: close #2091

Per Issue #2091, this pull request attempts to address an issue that could result in a StackOverflowError stemming from a cycle of cascading exceptions that originally stem from Flink's SerializedThrowable handler. This fix has already been made within Flink in this commit which should prevent the behavior (see discussion here for more context).

Brief change log

This change introduces a new private functions within the ExceptionUtils class to support exception chain evaluation for suppression and cause chains (existsInExceptionChain). This function is applied during the firstOrSuppressed function call, which introduces a new exception to the existing chain, and traverses both the suppression and cause chains using a graph to evaluate for existence.

Tests

The ExceptionTestUtils.testFirstOrSuppressedCyclePrevention was initially updated to use an arbitrary recursive exception call to mimic Flink's existing SerializedThrowable to reproduce the original issue (triggering a StackOverflowError). This test was later updated after the fix was applied to ensure that these previous exceptions no longer result in a cycle being created.

API and Format

N/A

Documentation

N/A

@rionmonster rionmonster changed the title Fluss 2091 [FLUSS-2091][common] Introduced Cycle Detection During Exception Suppression Dec 6, 2025
@rionmonster rionmonster marked this pull request as ready for review December 8, 2025 18:59
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.

Flink taskmanager failed with StackOverflowError: null

1 participant