Repository navigation
GCS: FileWriter.Size: include number of buffered bytes if the FileWriter is not closed - #1703
Merged
Merged
Conversation
…ter is not closed Signed-off-by: Arthur Baars <[email protected]>
Contributor
Author
|
Closing in favour of #1705 |
Contributor
Author
|
LGTM |
Collaborator
|
LGTM |
1 similar comment
|
LGTM |
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.
@RichardScothern This is a quick patch for #1698. Note that this PR targets the release/2.4 branch instead of master. I am not sure this is the right way of submitting a "hot fix" to a release.
@aaronlehmann The cause of the problem is that the registry calls the FileWriter.Size function of the GCS driver before closing the FileWriter. The Size function of the GCS driver used to report the number of bytes that were correctly saved to cloud storage. This excludes any bytes that are buffered in memory. The registry seems to expect that the Size function returns the size including the buffered bytes, regardless of whether these bytes will ever make it to the backing storage (the future Close call may occasionally fail).
In my opinion Size should report only the bytes that are guaranteed to have made it to the backing storage. However, changing that requires changes to the registry code and possible the other storage drivers. So for now, I think this PR is a good enough patch to ensure the GCS driver works again.