Page MenuHomePhabricator

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

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

Details

Summary

PR13039 backport https://github.com/bitcoin/bitcoin/pull/13039/files
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.
(c.f. https://lwn.net/SubscriberLink/752063/12b232ab5039efbe/)

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

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

Event Timeline

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

I await your review, then :)

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