From d3a90d16c3548869d3ca21147d983bb733b12d1f Mon Sep 17 00:00:00 2001 From: Unrud Date: Sat, 15 Jul 2017 09:42:00 +0200 Subject: [PATCH] Improve log message when fsync'ing directory fails (fixes 656) --- radicale/storage.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/radicale/storage.py b/radicale/storage.py index 47f1d330..3a2dd6d5 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -688,11 +688,15 @@ class Collection(BaseCollection): if not cls.configuration.getboolean("storage", "filesystem_fsync"): return if os.name == "posix": - fd = os.open(path, 0) try: - cls._fsync(fd) - finally: - os.close(fd) + fd = os.open(path, 0) + try: + cls._fsync(fd) + finally: + os.close(fd) + except OSError as e: + raise RuntimeError("Fsync'ing directory %r failed: %s" % + (path, e)) from e @classmethod def _makedirs_synced(cls, filesystem_path):