rteval/SOURCES/rteval-hackbench.py-Do-not-...

42 lines
1.7 KiB
Diff

From 5ed68ae77ec05786aab99fbed35d0347a5d25997 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Fri, 20 Oct 2017 12:17:49 +0100
Subject: [PATCH 14/18] rteval: hackbench.py: Do not sleep if hackbench fails
from memory errors
Do not sleep if hackbench fails to launch due to out-of-memory errors.
This can cause rteval to execute correctly without applying a full
stress load. Instead, exit gracefully
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/loads/hackbench.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 8456a24f4bba..9d3f6c834356 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -150,14 +150,10 @@ class Hackbench(CommandLineLoad):
except OSError, e:
if e.errno != errno.ENOMEM:
raise e
- # Catch out-of-memory errors and wait a bit to (hopefully)
- # ease memory pressure
- self._log(Log.DEBUG, "ERROR: %s, sleeping for %f seconds" % (e.strerror, self.__err_sleep))
- time.sleep(self.__err_sleep)
- if self.__err_sleep < 60.0:
- self.__err_sleep *= 2.0
- if self.__err_sleep > 60.0:
- self.__err_sleep = 60.0
+ # Exit gracefully without a traceback for out-of-memory errors
+ self._log(Log.DEBUG, "ERROR, ENOMEM while trying to launch hackbench")
+ print("out-of-memory trying to launch hackbench, exiting")
+ sys.exit(-1)
def WorkloadAlive(self):
--
2.14.3