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:02:28 -0500 |
commit | 43c8a2eccc69667fa16b61796de24b43c9370490 (patch) | |
tree | e240f40de553ec3ba1840c3c8fc617f93f385269 | |
parent | 2d476a6dcf466e89efe27a22363dbde2d131836b (diff) | |
download | rteval-v2/master.tar.gz |
rteval: hackbench.py: Do not sleep if hackbench fails from memory errorsv2/master
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): |