diff --git a/config.yaml b/config.yaml index cea53d9..b114e4b 100644 --- a/config.yaml +++ b/config.yaml @@ -105,6 +105,11 @@ options: type: int description: | Number of replication workers to spawn. + object-rsync-timeout: + default: 900 + type: int + description: | + Max duration of a partition rsync. nagios-check-params: default: "-m -r 60 180 10 20" type: string diff --git a/lib/swift_storage_context.py b/lib/swift_storage_context.py index 71ab007..efa388e 100644 --- a/lib/swift_storage_context.py +++ b/lib/swift_storage_context.py @@ -92,5 +92,6 @@ class SwiftStorageServerContext(OSContextGenerator): 'object_max_connections': config('object-max-connections'), 'object_replicator_concurrency': config( 'object-replicator-concurrency'), + 'object_rsync_timeout': config('object-rsync-timeout'), } return ctxt diff --git a/templates/object-server.conf b/templates/object-server.conf index d49aeaa..1f1c5b6 100644 --- a/templates/object-server.conf +++ b/templates/object-server.conf @@ -16,6 +16,7 @@ threads_per_disk = {{ object_server_threads_per_disk }} [object-replicator] concurrency = {{ object_replicator_concurrency }} +rsync_timeout = {{ object_rsync_timeout }} [object-updater] diff --git a/unit_tests/test_swift_storage_context.py b/unit_tests/test_swift_storage_context.py index 004e669..e2bb0b2 100644 --- a/unit_tests/test_swift_storage_context.py +++ b/unit_tests/test_swift_storage_context.py @@ -90,6 +90,7 @@ class SwiftStorageContextTests(CharmTestCase): self.test_config.set('account-max-connections', '10') self.test_config.set('container-max-connections', '10') self.test_config.set('object-max-connections', '10') + self.test_config.set('object-rsync-timeout', '950') ctxt = swift_context.SwiftStorageServerContext() result = ctxt() ex = { @@ -102,5 +103,6 @@ class SwiftStorageContextTests(CharmTestCase): 'account_max_connections': '10', 'container_max_connections': '10', 'object_max_connections': '10', + 'object_rsync_timeout': '950', } self.assertEqual(ex, result)