[Dataflow Streaming] Add a pipeline option to skip input elements that cannot be decoded successfully#37762
[Dataflow Streaming] Add a pipeline option to skip input elements that cannot be decoded successfully#37762scwhittle wants to merge 1 commit intoapache:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness of Dataflow streaming pipelines by introducing a new configuration option that allows workers to gracefully handle and skip input elements that cannot be successfully decoded. This prevents pipeline failures caused by corrupted data, ensuring continuous processing by logging errors and moving past malformed inputs. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
e19ab8f to
5d760aa
Compare
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
d02c734 to
e7c825f
Compare
… input elements. Such messages will log an error but are otherwise discarded.
e7c825f to
736fc0e
Compare
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
arunpandianp
left a comment
There was a problem hiding this comment.
A couple of questions around how ValueProviders work and a couple of nits.
Looks good otherwise.
...java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillKeyedWorkItem.java
Show resolved
Hide resolved
...worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillReaderIteratorBase.java
Show resolved
Hide resolved
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/PaneInfo.java
Show resolved
Hide resolved
|
|
||
| @Description( | ||
| "If true, log and skip input elements that are unable to successfully decode from the streaming backend.") | ||
| ValueProvider<Boolean> getSkipInputElementsWithDecodingExceptions(); |
There was a problem hiding this comment.
it is not clear why this needs to be a ValueProvider and not a Boolean. It seems like all the places where this is used are instantiated during the runtime and the pipeline options will be available there.
I'm not familiar with how ValueProviders work, does this need to be a ValueProvider?
There was a problem hiding this comment.
I was thinking that ValueProvider was needed for all templates but it is just classic templates. In the classic template case, the graph and pipeline serialization happens during template creation and the valueprovider is a placeholder that allows injecting the value later when the template is instantiated. Flex templates on the other hand rerun the graph and pipeline serialization logic each invocation and don't require them. In particular the source/reader is a serialized part of the graph. Given that this is more of an emergency option and a customer using a classic template may wish to use it, it seems worthwhile keeping it as a valueprovider.
| context.getWindmillTagEncoding(), | ||
| context.getDrainMode()); | ||
| context.getDrainMode(), | ||
| Boolean.TRUE.equals(skipDecodingExceptions.get())); |
There was a problem hiding this comment.
do we need a skipDecodingExceptions.isAccessible() check?
There was a problem hiding this comment.
Done, that seems safer and lets me cleanup the test where otherwise it was required to set it. I think if using a real runner it always initializes all the value providers during options deserialization.
| current = checkNotNull(decodeMessage(bundle.getMessages(messageIndex))); | ||
| return true; | ||
| } catch (RuntimeException | IOException e) { | ||
| if (Boolean.TRUE.equals(skipUndecodableElements.get())) { |
There was a problem hiding this comment.
do we need a skipDecodingExceptions.isAccessible() check?
Such messages have the exception logged but are otherwise discarded. This defaults to off but can be enabled during pipeline update as a possible mitigation for a pipeline that is stuck due to corrupted inputs.
Fix some suppressions while modifying.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.