Skip to content

Ensure exceptions are thrown and visible in PscTopicUriPartitionSplitReader#126

Merged
jeffxiang merged 1 commit intomainfrom
fix_silent_failure
Feb 6, 2026
Merged

Ensure exceptions are thrown and visible in PscTopicUriPartitionSplitReader#126
jeffxiang merged 1 commit intomainfrom
fix_silent_failure

Conversation

@jeffxiang
Copy link
Contributor

@jeffxiang jeffxiang commented Feb 5, 2026

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 (IllegalStateException and WakeupException) which require handling, and throwing any other exception type in order to make these exceptions visible via job failure / restart.

@jeffxiang jeffxiang marked this pull request as ready for review February 5, 2026 23:44
@jeffxiang jeffxiang requested a review from a team as a code owner February 5, 2026 23:44
markEmptySplitsAsFinished(recordsBySplits);
return recordsBySplits;
if (e.getCause() != null &&
(e.getCause().getClass().equals(IllegalStateException.class) || e.getCause().getClass().equals(WakeupException.class))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use this instead to cover any potential subclasses as well:

Throwable cause = e.getCause();
if (cause instanceof IllegalStateException || cause instanceof WakeupException) {
    ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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 jeffxiang merged commit 463c475 into main Feb 6, 2026
2 of 6 checks passed
@jeffxiang jeffxiang deleted the fix_silent_failure branch February 6, 2026 18:10
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
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.

2 participants

Comments