Repository navigation
feat(Storage): allow bypassing StreamWrapper permissions check to reduce cost/latency - #9733
Open
salilg-eng wants to merge 7 commits into
Open
salilg-eng wants to merge 7 commits into
salilg-eng wants to merge 7 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
salilg-eng
force-pushed
the
fix/streamwrapper-bypass
branch
from
September 25, 2026 08:42
5bde1ac to
1059410
Compare
kalragauri
reviewed
Oct 5, 2026
kalragauri
left a comment
There was a problem hiding this comment.
Please use standard GitHub closing syntax in the PR description so the public issue is linked properly: Fixes #1182
kalragauri
approved these changes
Oct 7, 2026
salilg-eng
force-pushed
the
fix/streamwrapper-bypass
branch
from
October 11, 2026 08:15
d1f9c83 to
111b938
Compare
salilg-eng
force-pushed
the
fix/streamwrapper-bypass
branch
from
October 11, 2026 08:17
111b938 to
eff99dd
Compare
bshaffer
reviewed
Oct 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1182
Description:
When using
is_readableorstatvia the PHP stream wrapper, the library currently tries to determine the stat mode by calling$this->bucket->isWritable(). This triggers an expensive Class-A API call (getResumeUri) to write an empty object. This leads to high latency, additional cost, and failure on read-only buckets.This PR introduces an opt-in bypass feature using stream context options. By setting
stat_permission_check => falsein the stream context for thegsprotocol, users can safely bypass this API call. When bypassed, the stream wrapper will optimistically assume the bucket has read/write permissions (mode100666), deferring actual permission checks to the subsequent read/write operations (which correctly throw 403 if unauthorized).Example Usage: