Skip to content

Enhance error handling in DelegatingMultiSinkOutputCommitter#1606

Open
psainics wants to merge 1 commit intodevelopfrom
fix/multisink-commit-error-logging
Open

Enhance error handling in DelegatingMultiSinkOutputCommitter#1606
psainics wants to merge 1 commit intodevelopfrom
fix/multisink-commit-error-logging

Conversation

@psainics
Copy link
Copy Markdown
Contributor

@psainics psainics commented Apr 9, 2026

This pull request improves error handling and logging in the DelegatingMultiSinkOutputCommitter class for BigQuery multi-sink operations. The main focus is to provide more informative log messages when task or job commits fail, making it easier to diagnose issues.

Enhanced error handling and logging:

  • Added a Logger instance (LOG) using SLF4J to the DelegatingMultiSinkOutputCommitter class for logging warnings. [1] [2]
  • Wrapped commitTask and commitJob calls in try-catch blocks to log warnings with detailed failure reasons when an IOException occurs, then re-throw the exception.
  • Introduced a private getFailureReason helper method to extract the root cause message from an IOException for clearer log output.

@psainics psainics self-assigned this Apr 9, 2026
@psainics psainics added the build Trigger unit test build label Apr 9, 2026
@psainics psainics requested a review from itsankit-google April 9, 2026 05:53
} catch (IOException e) {
LOG.warn("BigQuery multi-sink table '{}' failed during job commit. Reason: {}",
tableName, getFailureReason(e), e);
throw e;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logging and re-throwing an error is considered an anti-pattern.

Isn't this error propagated upwards and logged somewhere in pipeline run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Trigger unit test build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants