Skip to content

feat: add experimental large directory warning threshold#4736

Open
Haihan-Jiang wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
Haihan-Jiang:codex/gcsfuse-large-dir-warning
Open

feat: add experimental large directory warning threshold#4736
Haihan-Jiang wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
Haihan-Jiang:codex/gcsfuse-large-dir-warning

Conversation

@Haihan-Jiang

Copy link
Copy Markdown

What

Adds a hidden experimental --experimental-large-dir-warning-threshold flag / config field under file-system. When the threshold is greater than zero, directory reads log a warning after the final directory entry list reaches or exceeds the threshold. A value of 0 keeps the behavior disabled.

This covers the warning signal requested in #4696 without changing write-path behavior or claiming to solve the full large-directory guard/streaming work.

Validation

  • go test ./cfg
  • docker run --rm -v "$PWD":/work -v gcsfuse-go-mod-cache:/go/pkg/mod -v gcsfuse-go-build-cache:/root/.cache/go-build -w /work golang:1.26.3 go test ./cfg ./internal/fs/inode ./internal/fs/handle
  • git diff --check

Updates #4696

@Haihan-Jiang Haihan-Jiang requested a review from a team as a code owner May 27, 2026 01:14
@Haihan-Jiang Haihan-Jiang requested a review from geertj May 27, 2026 01:14
@Haihan-Jiang Haihan-Jiang changed the title Add experimental large directory warning threshold feat: add experimental large directory warning threshold May 27, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 an experimental monitoring feature that allows users to log warnings when directory listings exceed a specified entry count. By adding a configurable threshold, the system provides visibility into large directory structures without altering core write-path behaviors, addressing the signal requirements for tracking large directory performance.

Highlights

  • Experimental Feature Flag: Introduced a hidden experimental flag --experimental-large-dir-warning-threshold to monitor directory sizes.
  • Logging Mechanism: Implemented logic to log a warning when a directory listing reaches or exceeds the configured threshold.
  • Configuration Validation: Added validation to ensure the threshold value is non-negative, with corresponding unit tests.
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 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 .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 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

  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.

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

Copy link
Copy Markdown
Contributor

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 introduces an experimental configuration option, experimental-large-dir-warning-threshold, which logs a warning when a directory listing contains at least the specified number of entries. It adds the configuration parameter, CLI flag, validation logic, unit tests, and the core implementation in DirHandle to check and log the warning during directory read operations. I have no feedback to provide as there are no review comments.

@Haihan-Jiang

Copy link
Copy Markdown
Author

This is ready for review from my side. The title check has a later successful run after the initial failure, and the other visible checks are green. Could someone take a look when convenient?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant