Improve log message when fsync'ing directory fails (fixes 656)
This commit is contained in:
		| @@ -688,11 +688,15 @@ class Collection(BaseCollection): | |||||||
|         if not cls.configuration.getboolean("storage", "filesystem_fsync"): |         if not cls.configuration.getboolean("storage", "filesystem_fsync"): | ||||||
|             return |             return | ||||||
|         if os.name == "posix": |         if os.name == "posix": | ||||||
|  |             try: | ||||||
|                 fd = os.open(path, 0) |                 fd = os.open(path, 0) | ||||||
|                 try: |                 try: | ||||||
|                     cls._fsync(fd) |                     cls._fsync(fd) | ||||||
|                 finally: |                 finally: | ||||||
|                     os.close(fd) |                     os.close(fd) | ||||||
|  |             except OSError as e: | ||||||
|  |                 raise RuntimeError("Fsync'ing directory %r failed: %s" % | ||||||
|  |                                    (path, e)) from e | ||||||
|  |  | ||||||
|     @classmethod |     @classmethod | ||||||
|     def _makedirs_synced(cls, filesystem_path): |     def _makedirs_synced(cls, filesystem_path): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Unrud
					Unrud