Page MenuHomePhabricator

Merge #13039: Add logging and error handling for file syncing

Authored by markblundeberg on Jul 7 2019, 20:21.



PR13039 backport
cf02779 Add logging and error handling for file syncing (Wladimir J. van der Laan)

Pull request description:

Add logging and error handling inside, and outside of FileCommit.
Functions such as fsync, fdatasync will return error in case of hardware I/O errors, and ignoring this means it can silently continue through data corruption.

EINVAL is handled specially to avoid crashing out on (network, fuse) filesystems that don't handle `f[data]sync`.

I checked that the syncing inside leveldb is already generating an I/O error as appropriate.

Depends on D3582

Test Plan

make check

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markblundeberg created this revision.Jul 7 2019, 20:21
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 7 2019, 20:21
deadalnix requested changes to this revision.Jul 8 2019, 00:50

Why C style error handling is garbage illustrated. I'll do a proper review later on.

This revision now requires changes to proceed.Jul 8 2019, 00:50
markblundeberg requested review of this revision.Jul 9 2019, 14:37

I await your review, then :)

deadalnix accepted this revision.Jul 9 2019, 17:33
This revision is now accepted and ready to land.Jul 9 2019, 17:33