Set consuming_received_data=True during bundle setup#38136
Set consuming_received_data=True during bundle setup#38136hjtran wants to merge 1 commit intoapache:masterfrom
Conversation
Runners polling ProcessBundleProgress could not distinguish between "still setting up" and "idle/caught up" since both reported consuming_received_data=False. Now the flag is True from the start of process_bundle through setup, then set to False once setup completes and before entering the data processing loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 improves the observability of bundle processing by refining the state reporting mechanism. By explicitly setting the consumption flag during the setup phase, it resolves ambiguity for runners that monitor progress, ensuring that an idle status is only reported when the worker has truly finished processing all received data. 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
|
Problem
If an sdk worker is processing a stage with long bundle startup times, it's not currently possible for a runner to tell whether the worker is idle and ready for work or if it's still running
setup_bundle. Consider the following order of events:Runner sends
ProcessBundleRequestRunner sends data on the input data channel
Runner sends a
ProcessBundleProgressRequestto see if the worker is done and ready for more inputsIf the worker returns a
ProcessBundleProgressResponsewithconsuming_received_data=False, the worker might actually still be just runningsetup_bundle. In the worse case, a runner may misinterpret this signal and repeatedly queue up a large queue of work for the worker that it could've distributed over many workersSummary of changes
consuming_received_datatoTrueat the start ofprocess_bundle, so runners pollingProcessBundleProgresscan distinguish "still setting up / actively processing" from "idle and caught up with all received data."False, making them indistinguishable.Falsebefore entering the data processing loop.The semantic meaning of
consuming_received_datais not really respected now (for example, a runner could send aProcessBundleRequestand never send any input data and yet the worker would briefly report that it's "consuming received data" when it has received no data), but I think this better implements the intent of the field.Without this change, it's impossible for a runner to definitively know whether a python sdk worker is actually idle