-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
ARROW-15115: [C++] GcsFileSystem return errors if using closed streams #11976
ARROW-15115: [C++] GcsFileSystem return errors if using closed streams #11976
Conversation
return stream_.tellg() + offset_; | ||
} | ||
|
||
bool closed() const override { return !stream_.IsOpen(); } | ||
bool closed() const override { return closed_ && !stream_.IsOpen(); } |
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.
Is there a reason this is &&
rather than ||
?
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.
Yes. zero-length objects are "born closed" in google-cloud-cpp
. Probably a bug (or at least a very poorly thought API), but you can read()
from them, while they return IsOpen() == false
.
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.
Ah, can you add a comment about that?
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.
Done. That got me thinking about the similar expression for output streams, and you were right in that case. Fixed that too.
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.
+1, thank you @coryan
Benchmark runs are scheduled for baseline = 61745be and contender = 04641a3. 04641a3 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Closes apache#11976 from coryan/ARROW-15115-gcsfs-report-more-read-write-errors Authored-by: Carlos O'Ryan <coryan@google.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
No description provided.