Retry starting SubprocessServer on failure#39159
Conversation
Wraps the subprocess startup and connection sequence in a retry loop with a limit of 3 attempts. This mitigates "address already in use" errors caused by race conditions during dynamic port allocation.
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 introduces a robust retry mechanism for the SubprocessServer startup sequence. By wrapping the server initialization in a retry loop, the system can now gracefully recover from 'address already in use' errors that occur due to race conditions during dynamic port allocation, thereby increasing the stability of integration tests. Highlights
New Features🧠 You can now enable Memory (public preview) 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 the 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 counterproductive. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces retry logic (up to 3 attempts) with a 1-second delay when starting a subprocess server in subprocess_server.py, and updates the corresponding tests to verify this behavior. The reviewer noted that changing the bare except block to except Exception as e prevents catching BaseException (such as KeyboardInterrupt), which could lead to leaked subprocesses on interruption. They suggested adding a bare except block to handle cleanup in those cases.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Assigning reviewers: R: @jrmccluskey for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Wraps the subprocess startup and connection sequence in a retry loop with a limit of 3 attempts. This mitigates "address already in use" errors caused by race conditions during dynamic port allocation. Basically, we pick a random port but before using it to start a server it is occupied by other thread/worker.
An example failed test:
https://github.com/apache/beam/actions/runs/28321549831/job/83904243793
Traceback: