From 304ea48213f0251d9768aa3e6b7e64e15329103e Mon Sep 17 00:00:00 2001 From: Michael Barton Date: Thu, 27 Jan 2011 21:02:53 +0000 Subject: [PATCH] object replicator logging and increase rsync timeouts --- etc/object-server.conf-sample | 8 ++++---- swift/obj/replicator.py | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/etc/object-server.conf-sample b/etc/object-server.conf-sample index 6c696a5872..f3f7f07346 100644 --- a/etc/object-server.conf-sample +++ b/etc/object-server.conf-sample @@ -42,13 +42,13 @@ use = egg:swift#object # concurrency = 1 # stats_interval = 300 # max duration of a partition rsync -# rsync_timeout = 600 +# rsync_timeout = 900 # passed to rsync for io op timeout -# rsync_io_timeout = 10 +# rsync_io_timeout = 30 # max duration of an http request # http_timeout = 60 # attempts to kill all workers if nothing replicates for lockup_timeout seconds -# lockup_timeout = 900 +# lockup_timeout = 1800 # The replicator also performs reclamation # reclaim_age = 604800 @@ -71,4 +71,4 @@ use = egg:swift#object # log_level = INFO # files_per_second = 20 # bytes_per_second = 10000000 -# log_time = 3600 \ No newline at end of file +# log_time = 3600 diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index fc7e7cbd07..2c04829138 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -223,10 +223,10 @@ class ObjectReplicator(Daemon): self.reclaim_age = int(conf.get('reclaim_age', 86400 * 7)) self.partition_times = [] self.run_pause = int(conf.get('run_pause', 30)) - self.rsync_timeout = int(conf.get('rsync_timeout', 300)) - self.rsync_io_timeout = conf.get('rsync_io_timeout', '10') + self.rsync_timeout = int(conf.get('rsync_timeout', 900)) + self.rsync_io_timeout = conf.get('rsync_io_timeout', '30') self.http_timeout = int(conf.get('http_timeout', 60)) - self.lockup_timeout = int(conf.get('lockup_timeout', 900)) + self.lockup_timeout = int(conf.get('lockup_timeout', 1800)) def _rsync(self, args): """ @@ -252,7 +252,10 @@ class ObjectReplicator(Daemon): continue if result.startswith('cd+'): continue - self.logger.info(result) + if not retval: + self.logger.info(result) + else: + self.logger.error(result) if ret_val: self.logger.error(_('Bad rsync return code: %(args)s -> %(ret)d'), {'args': str(args), 'ret': ret_val})