Fix a timeout error on Windows when writing to a S3 bucket#141
Open
edouarda wants to merge 1 commit intorockset:masterfrom
Open
Fix a timeout error on Windows when writing to a S3 bucket#141edouarda wants to merge 1 commit intorockset:masterfrom
edouarda wants to merge 1 commit intorockset:masterfrom
Conversation
* Binary files must be opened with the binary flag or reading may stop before EOF, causing a timeout as AWS waits for the end of the file * Added an #undef for GetFreeSpace to fix a compilation error on Windows * Added default definition when USE_AWS is 0 * Fixed integer cast * Fixed uninitialized variable warning * Fixed include
|
@mrambacher This is a very interesting fix because it uses "std::ios_base::binary". Can you pl review this one and then do the needful? thanks. |
mrambacher
approved these changes
Sep 20, 2021
Collaborator
mrambacher
left a comment
There was a problem hiding this comment.
This looks fine to me. I am not sure I understand why/where the timeout failure on Windows is, so it might be nice to add a comment somewhere (even in the PR) explaining the fix and why it wors.
| #ifdef _WIN32_WINNT | ||
| #undef GetFreeSpace | ||
| #endif | ||
|
|
Collaborator
There was a problem hiding this comment.
Other places seem to undef this based on it being defined, not based on Windows. Can we follow the same pattern?
| uint64_t usage = cloud_env_options.sst_file_cache->GetUsage(); | ||
| uint64_t capacity = cloud_env_options.sst_file_cache->GetCapacity(); | ||
| long percent = (capacity > 0 ? (100L * usage / capacity) : 0); | ||
| auto percent = (capacity > 0 ? (100L * usage / capacity) : 0); |
Collaborator
There was a problem hiding this comment.
why the change to auto?
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.
before EOF, causing a timeout as AWS waits for the end of the file
Windows