Leverage alpine rather than golang
[functest-kubernetes.git] / docker / core / Switch-to-threading.Thread-for-Rally-tasks.patch
1 From 7223c6c766d2cbd47c54048426c904a27b52e069 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?C=C3=A9dric=20Ollivier?= <cedric.ollivier@orange.com>
3 Date: Wed, 3 Jun 2020 15:23:59 +0200
4 Subject: [PATCH] Switch to threading.Thread() for Rally tasks
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 multiprocessing.Process() often fails due to thread crashes [1].
10 It looks similar to gsutil release notes [2].
11
12 [1] https://build.opnfv.org/ci/job/functest-opnfv-functest-benchmarking-cntt-latest-rally_full_cntt-run/35/console
13 [2] https://github.com/GoogleCloudPlatform/gsutil/issues/548
14 [3] https://github.com/GoogleCloudPlatform/gsutil/blob/master/CHANGES.md
15
16 Change-Id: I582933832e23d188c7fa5999e713dd5d7e82d2da
17 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
18 (cherry picked from commit 9b07423c246e7e4ab9fa25851d79ce6986c10c2e)
19 ---
20  rally/task/runner.py | 7 ++++---
21  1 file changed, 4 insertions(+), 3 deletions(-)
22
23 diff --git a/rally/task/runner.py b/rally/task/runner.py
24 index 55372e509..0f0245588 100644
25 --- a/rally/task/runner.py
26 +++ b/rally/task/runner.py
27 @@ -17,6 +17,7 @@ import abc
28  import collections
29  import copy
30  import multiprocessing
31 +import threading
32  import time
33  
34  import six
35 @@ -188,9 +189,9 @@ class ScenarioRunner(plugin.Plugin, validation.ValidatablePluginMixin):
36          for i in range(processes_to_start):
37              kwrgs = {"processes_to_start": processes_to_start,
38                       "processes_counter": i}
39 -            process = multiprocessing.Process(target=worker_process,
40 -                                              args=next(worker_args_gen),
41 -                                              kwargs={"info": kwrgs})
42 +            process = threading.Thread(target=worker_process,
43 +                                       args=next(worker_args_gen),
44 +                                       kwargs={"info": kwrgs})
45              process.start()
46              process_pool.append(process)
47  
48 -- 
49 2.26.2
50