Detect I/O failures on Linux/Mac#11
Merged
Merged
Conversation
jack-pappas
force-pushed
the
fix-sds-check-io-success
branch
3 times, most recently
from
October 19, 2020 17:42
a613e41 to
ba25316
Compare
On non-Windows platforms, detect whether calls to pread()/pwrite() succeed; when those calls fail, follow the existing pattern we have for the Windows-based code to print an error message and return 0. (We may want to make additional improvements in this area, but at least Windows and Linux/Mac behavior are now consistent).
jack-pappas
force-pushed
the
fix-sds-check-io-success
branch
from
October 19, 2020 20:52
ba25316 to
cd740cf
Compare
jack-pappas
marked this pull request as ready for review
October 19, 2020 20:59
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.
On non-Windows platforms, detect whether calls to
pread()/pwrite()succeed; when those calls fail, follow the existing pattern we have for the Windows-based code to print an error message and return 0. This change does not fully fix #10 but at least makes the behavior consistent between Windows and Linux/Mac -- read/write failures are detected and an error message is printed to stdout.We'll still need a follow-up commit to bubble up these read/write failures through any functions calling
SDSReadFileChunkandSDSWriteFileChunk, so we can ultimately raise a Python error and avoid returning a Dataset with uninitialized data.