aboutsummaryrefslogtreecommitdiffstats
path: root/docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-06-04 10:14:06 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2020-06-04 10:19:09 +0200
commit39823fdbf534d05bfc3ddf4ddd5b8f8c3d603038 (patch)
treee0d7d33aa2d52ef2be183edfc936afa41a4ee1f1 /docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch
parent37b7e536d679303ad6ddfade450201efd90a983a (diff)
Rename patch name and removes debug logs
The debug logs works only vs py3.8 and breaks backport to Iruya. Change-Id: Ie91a8a876e263a83b6ae3fbfb5bb05644b87b970 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch')
-rw-r--r--docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch b/docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch
new file mode 100644
index 000000000..d65967ad6
--- /dev/null
+++ b/docker/core/Switch-to-threading.Thread-for-Rally-tasks.patch
@@ -0,0 +1,73 @@
+From 9b07423c246e7e4ab9fa25851d79ce6986c10c2e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?C=C3=A9dric=20Ollivier?= <cedric.ollivier@orange.com>
+Date: Wed, 3 Jun 2020 15:23:59 +0200
+Subject: [PATCH] Switch to threading.Thread() for Rally tasks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+multiprocessing.Process() often fails due to thread crashes [1].
+It looks similar to gsutil release notes [2].
+
+[1] https://build.opnfv.org/ci/job/functest-opnfv-functest-benchmarking-cntt-latest-rally_full_cntt-run/35/console
+[2] https://github.com/GoogleCloudPlatform/gsutil/issues/548
+[3] https://github.com/GoogleCloudPlatform/gsutil/blob/master/CHANGES.md
+
+Change-Id: I582933832e23d188c7fa5999e713dd5d7e82d2da
+Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
+---
+ rally/cli/main.py | 5 ++++-
+ rally/task/runner.py | 7 ++++---
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/rally/cli/main.py b/rally/cli/main.py
+index 235a57113..14c057c0e 100644
+--- a/rally/cli/main.py
++++ b/rally/cli/main.py
+@@ -15,6 +15,10 @@
+
+ """CLI interface for Rally."""
+
++STACK_SIZE = 1024 * 1024
++import threading
++threading.stack_size(STACK_SIZE)
++
+ import sys
+
+ from rally.cli import cliutils
+@@ -25,7 +29,6 @@ from rally.cli.commands import plugin
+ from rally.cli.commands import task
+ from rally.cli.commands import verify
+
+-
+ categories = {
+ "db": db.DBCommands,
+ "env": env.EnvCommands,
+diff --git a/rally/task/runner.py b/rally/task/runner.py
+index 3397e1193..5edebb406 100644
+--- a/rally/task/runner.py
++++ b/rally/task/runner.py
+@@ -17,6 +17,7 @@ import abc
+ import collections
+ import copy
+ import multiprocessing
++import threading
+ import time
+
+ from rally.common import logging
+@@ -186,9 +187,9 @@ class ScenarioRunner(plugin.Plugin, validation.ValidatablePluginMixin,
+ for i in range(processes_to_start):
+ kwrgs = {"processes_to_start": processes_to_start,
+ "processes_counter": i}
+- process = multiprocessing.Process(target=worker_process,
+- args=next(worker_args_gen),
+- kwargs={"info": kwrgs})
++ process = threading.Thread(target=worker_process,
++ args=next(worker_args_gen),
++ kwargs={"info": kwrgs})
+ process.start()
+ process_pool.append(process)
+
+--
+2.26.2
+