Ensure exceptions are thrown and visible in PscTopicUriPartitionSplitReader#126
Merged
Ensure exceptions are thrown and visible in PscTopicUriPartitionSplitReader#126
Conversation
vahidhashemian
approved these changes
Feb 6, 2026
| markEmptySplitsAsFinished(recordsBySplits); | ||
| return recordsBySplits; | ||
| if (e.getCause() != null && | ||
| (e.getCause().getClass().equals(IllegalStateException.class) || e.getCause().getClass().equals(WakeupException.class))) { |
Contributor
There was a problem hiding this comment.
Should we use this instead to cover any potential subclasses as well:
Throwable cause = e.getCause();
if (cause instanceof IllegalStateException || cause instanceof WakeupException) {
...
}
Contributor
Author
There was a problem hiding this comment.
unfortunately we cannot use instanceof because IllegalStateException can be extended by many other exceptions. For the handling of this exception, we only want to cover the case where the first-order cause is precisely an IllegalStateException.
jeffxiang
added a commit
that referenced
this pull request
Feb 6, 2026
jeffxiang
added a commit
that referenced
this pull request
Feb 6, 2026
* Ensure exceptions are thrown and visible in PscTopicUriPartitionSplitReader (#126) * Bump version to 4.1.5-RC1
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.
Flink source consumers running into poll exceptions can encounter silent / invisible failures. This is due to the fact that the PSC-Flink connector catches and swallows all ConsumerExceptions in this block:
https://github.com/pinterest/psc/blob/4.0/psc-flink/src/main/java/com/pinterest/flink/connector/psc/source/reader/PscTopicUriPartitionSplitReader.java#L111-L120
This PR fixes the behavior by swallowing only the exception types (
IllegalStateExceptionandWakeupException) which require handling, and throwing any other exception type in order to make these exceptions visible via job failure / restart.