-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Re-throw StorageException as IOException #27007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mrcnc
wants to merge
1
commit into
trinodb:master
Choose a base branch
from
mrcnc:rethrow-swallowed-gcs-exception
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1
−0
Conversation
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR modifies the GcsOutputStream.close method to catch any StorageException and immediately wrap it in an IOException rather than ignoring it, ensuring transient GCS errors aren’t silently dropped and aligning with S3OutputStream’s behavior. Class diagram for updated GcsOutputStream.close exception handlingclassDiagram
class GcsOutputStream {
+void close()
}
class StorageException {
+int getCode()
}
class IOException
class FileAlreadyExistsException
GcsOutputStream --> StorageException : catches
GcsOutputStream --> IOException : rethrows
GcsOutputStream --> FileAlreadyExistsException : throws if HTTP 412
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wendigo
approved these changes
Oct 18, 2025
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.
Description
Updates the close method GcsOutputStream to re-throw StorageException as IOException to avoid silently swallowing them.
Additional context and related issues
Currently when a StorageException is thrown, it is silently swallowed except if it's an HTTP 412. Therefore it's possible that a file was never written to GCS because of some other transient networking error, but the stream is marked as closed.
I checked the S3 implementation and see that it similarly re-throws these types of exceptions as
IOException
so this is consistent with other filesystem behavior.I came across this code while investigating an issue we encountered in one of our Iceberg tables. We can see files tracked in the Iceberg metadata that do not exist in the GCS bucket so it makes me suspect this is the root cause.
Release notes
( x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:
Summary by Sourcery
Bug Fixes: