diff --git a/etc/container-server.conf-sample b/etc/container-server.conf-sample index a6e72a2502..feca3c48e1 100644 --- a/etc/container-server.conf-sample +++ b/etc/container-server.conf-sample @@ -417,3 +417,8 @@ use = egg:swift#xprofile # limit may be changed by setting recon_candidates_limit to an integer value. A # negative value implies no limit. # recon_candidates_limit = 5 +# +# Large databases tend to take a while to work with, but we want to make sure +# we write down our progress. Use a larger-than-normal broker timeout to make +# us less likely to bomb out on a LockTimeout. +# broker_timeout = 60 diff --git a/swift/container/sharder.py b/swift/container/sharder.py index be243aba4f..c0b2d93755 100644 --- a/swift/container/sharder.py +++ b/swift/container/sharder.py @@ -141,6 +141,8 @@ class ContainerSharder(ContainerReplicator): self.auto_shard = config_true_value(conf.get('auto_shard', False)) self.recon_candidates_limit = int( conf.get('recon_candidates_limit', 5)) + self.broker_timeout = config_positive_int_value( + conf.get('broker_timeout', 60)) # internal client self.conn_timeout = float(conf.get('conn_timeout', 5)) @@ -978,7 +980,8 @@ class ContainerSharder(ContainerReplicator): node_id) continue - broker = ContainerBroker(path, logger=self.logger) + broker = ContainerBroker(path, logger=self.logger, + timeout=self.broker_timeout) error = None try: self._identify_sharding_candidate(broker, node)