From 3b166e6ba608194c4c7f1ced4dc579e26713ad18 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Wed, 8 Jan 2014 14:14:02 -0800 Subject: [PATCH] Log when quarantining an object When you're trying to troubleshoot why all your objects are getting quarantined, it's really nice to have some logging. If nothing else, it's nice to know which process did it. Change-Id: I6e8be6df938659f7392891df9336ed70bd155706 --- swift/obj/diskfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swift/obj/diskfile.py b/swift/obj/diskfile.py index c9e5c7ccb8..6d527c3b40 100644 --- a/swift/obj/diskfile.py +++ b/swift/obj/diskfile.py @@ -824,6 +824,8 @@ class DiskFileReader(object): def _quarantine(self, msg): self._quarantined_dir = self._threadpool.run_in_thread( quarantine_renamer, self._device_path, self._data_file) + self._logger.warn("Quarantined object %s: %s" % ( + self._data_file, msg)) self._logger.increment('quarantines') self._quarantine_hook(msg) @@ -1019,6 +1021,8 @@ class DiskFile(object): """ self._quarantined_dir = self._threadpool.run_in_thread( quarantine_renamer, self._device_path, data_file) + self._logger.warn("Quarantined object %s: %s" % ( + data_file, msg)) self._logger.increment('quarantines') return DiskFileQuarantined(msg)