diff options
author | John Kacur <jkacur@redhat.com> | 2017-10-20 12:17:49 +0100 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2017-10-24 14:04:16 -0500 |
commit | 5ed68ae77ec05786aab99fbed35d0347a5d25997 (patch) | |
tree | 6d210b1261e75ea5c81c865d3870c5376bfd77cc | |
parent | eead2e5e5a1d6d93f4447cd7c8bf32e9988caada (diff) | |
download | rteval-master.tar.gz |
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>
-rw-r--r-- | rteval/modules/loads/hackbench.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py index 8456a24..9d3f6c8 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): |