Skip to content

Commit f155d2b

Browse files
committed
swift: avoid Connection aborted
This change removes usage of threads with swift driver. This avoids to get "Connection aborted" because a thread is stuck and the server side decide to break the connection. Related-bug: gnocchixyz#509
1 parent 2a76e73 commit f155d2b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gnocchi/service.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ def prepare_service(args=None, conf=None,
5353
default_config_files=default_config_files,
5454
version=gnocchi.__version__)
5555

56-
utils.parallel_map.MAX_WORKERS = conf.parallel_operations
56+
if conf.storage.driver == "swift":
57+
# NOTE(sileht): Using threads with swiftclient doesn't work
58+
# as expected, so disable it
59+
utils.parallel_map.MAX_WORKERS = 1
60+
else:
61+
utils.parallel_map.MAX_WORKERS = conf.parallel_operations
5762

5863
if not log_to_std and (conf.log_dir or conf.log_file):
5964
outputs = [daiquiri.output.File(filename=conf.log_file,

0 commit comments

Comments
 (0)