Skip to content

Conversation

@cpriti-os
Copy link
Contributor

No description provided.

@cpriti-os cpriti-os requested review from a team as code owners January 21, 2026 14:10
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 21, 2026
@cpriti-os cpriti-os marked this pull request as draft January 21, 2026 14:10
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @cpriti-os, 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 addresses a potential deadlock scenario in the MultiRangeDownloader's event loop by introducing an internal queue for outgoing requests. This change allows the event loop to process commands and session responses without blocking on sending requests, thereby improving the robustness and responsiveness of the multi-range download process. The implementation includes congestion control and prioritized handling for retried requests.

Highlights

  • Request Queue Introduction: Introduced an unsentRequests queue (using container/list) within the multiRangeDownloaderManager to manage outgoing BidiReadObjectRequests, decoupling request generation from immediate sending.
  • Asynchronous Request Sending: Refactored the eventLoop to asynchronously send requests from the unsentRequests queue to the current session's request channel, preventing potential deadlocks caused by blocking sends.
  • Congestion Control: Implemented a congestion control mechanism that returns an error if the unsentRequests queue exceeds a predefined limit (10,000 requests), preventing unbounded memory growth and resource exhaustion.
  • Prioritized Retries: Modified the retry logic in ensureSession to push retried requests to the front of the unsentRequests queue, giving them higher priority for re-transmission.
  • Completion Logic Update: Updated the completion condition in the eventLoop to ensure all requests, including those currently residing in the unsentRequests queue, are processed before signaling overall completion.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively resolves a potential deadlock in the event loop by introducing an internal queue for outgoing requests and using a non-blocking send pattern. This decouples command processing from network writes, preventing the event loop from blocking. The changes are logical and well-implemented, including a backpressure mechanism to handle congestion. I have one minor suggestion to improve maintainability by replacing a magic number with a named constant.

@cpriti-os cpriti-os marked this pull request as ready for review January 22, 2026 04:24
@cpriti-os cpriti-os added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Jan 22, 2026
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Minor suggestion, overall LGTM.

@cpriti-os cpriti-os merged commit 7d9d00c into googleapis:main Jan 28, 2026
10 checks passed
cpriti-os added a commit that referenced this pull request Jan 28, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.8.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-go@sha256:718167d5c23ed389b41f617b3a00ac839bdd938a6bd2d48ae0c2f1fa51ab1c3d
<details><summary>storage: 1.59.2</summary>

##
[1.59.2](storage/v1.59.1...storage/v1.59.2)
(2026-01-28)

### Bug Fixes

* deadlock in event loop while coordinating channels (#13652)
([ff6c8e7](ff6c8e78))

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

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants