Skip to content

Commit

Permalink
swift: avoid Connection aborted
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sileht committed May 22, 2018
1 parent 2a76e73 commit f155d2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gnocchi/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def prepare_service(args=None, conf=None,
default_config_files=default_config_files,
version=gnocchi.__version__)

utils.parallel_map.MAX_WORKERS = conf.parallel_operations
if conf.storage.driver == "swift":
# NOTE(sileht): Using threads with swiftclient doesn't work
# as expected, so disable it
utils.parallel_map.MAX_WORKERS = 1
else:
utils.parallel_map.MAX_WORKERS = conf.parallel_operations

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

0 comments on commit f155d2b

Please sign in to comment.