Changes cleanup thread to forceExecute. (#38073)#38169
Changes cleanup thread to forceExecute. (#38073)#38169acrites wants to merge 1 commit intoapache:release-2.73from
Conversation
* Changes cleanup thread to forceExecute. Otherwise, we can deadlock if all finalization threads are running. * Changes cacheCommitFinalizers loop to only acquire the lock once and to not queue cleanup thread while holding the lock. * Changes bundle finalizers to run in a dedicated ScheduledExecutorService to simplify logic and prevent it from blocking work item processing. Adds an integration test at StreamingDataflowWorker level. * Changes thread pool to a single thread and moves scheduling cleanup under the lock to prevent race with adding to commitFinalizationCallbacks. * Uses other applied_finalize_ids after merging in apache#37954
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 refactors the cleanup mechanism for bundle finalization in the StreamingDataflowWorker. By moving cleanup tasks to a dedicated ScheduledExecutorService, the changes prevent potential deadlocks that could occur when finalization threads are exhausted. This architectural shift simplifies the cleanup logic and ensures that cleanup tasks do not interfere with critical WorkItem processing. 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. 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. Footnotes
|
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
| + " }" | ||
| + " }" | ||
| + "}" | ||
| + "applied_finalize_ids: " |
There was a problem hiding this comment.
org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.TextFormat$ParseException: 1:276: Input contains unknown fields and/or extensions:
1:276: windmill.GetWorkResponse.applied_finalize_ids
at app//org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.TextFormat$Parser.checkUnknownFields(TextFormat.java:1761)
at app//org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.TextFormat$Parser.merge(TextFormat.java:1780)
at app//org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.TextFormat$Parser.merge(TextFormat.java:1670)
at app//org.apache.beam.vendor.grpc.v1p69p0.com.google.protobuf.TextFormat.merge(TextFormat.java:1450)
at app//org.apache.beam.runners.dataflow.worker.StreamingDataflowWorkerTest.buildInput(StreamingDataflowWorkerTest.java:570)
at app//org.apache.beam.runners.dataflow.worker.StreamingDataflowWorkerTest.makeInput(StreamingDataflowWorkerTest.java:673)
at app//org.apache.beam.runners.dataflow.worker.StreamingDataflowWorkerTest.testBundleFinalizersAreCalled(StreamingDataflowWorkerTest.java:4344)
Runs cleanup thread in its own executor.
Otherwise, we can deadlock if all finalization threads are running. This can happen if e.g. a worker starts up and the pipeline has already been running. It then first gets a bunch of ids to execute and then gets gets a callback to register, which starts up the cleanup thread.
This PR also moves cleanups to a separate ScheduledExecutorService to simplify the cleanup logic as well as prevent it from blocking WorkItem processing.
This is part of a fix of changes in PR #37723.
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.