From 1f2e8fe5280db96b0b56e226618f817b744176cb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 27 Feb 2014 23:36:22 +0000 Subject: Don't throw a wobbly while backing up if files don't exist. Reading extended attributes may fail with an error if the file was removed (race condition) or in tests when generating random nonexistent directory entries. Handle this more gracefully by not backing up the extended attributes instead of dying completely. --- lib/backupstore/BackupClientFileAttributes.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/backupstore/BackupClientFileAttributes.cpp b/lib/backupstore/BackupClientFileAttributes.cpp index d76432ba..53215b7c 100644 --- a/lib/backupstore/BackupClientFileAttributes.cpp +++ b/lib/backupstore/BackupClientFileAttributes.cpp @@ -664,12 +664,17 @@ void BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock &outputBloc "attributes of '" << Filename << "': " "buffer too small, not backed up"); } + else if(errno == ENOENT) + { + BOX_ERROR("Failed to list extended " + "attributes of '" << Filename << "': " + "file no longer exists"); + } else { - BOX_LOG_SYS_ERROR("Failed to list extended " - "attributes of '" << Filename << "', " - "not backed up"); - THROW_EXCEPTION(CommonException, OSFileError); + THROW_SYS_FILE_ERROR("Failed to list extended " + "attributes, skipping them", Filename, + CommonException, OSFileError); } } } -- cgit v1.2.3