45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
From b5e7448bd7a12426fb47df6809fa9e5b3bcbdfef Mon Sep 17 00:00:00 2001
|
|
From: Colin Ian King <colin.king@canonical.com>
|
|
Date: Thu, 21 May 2020 08:05:14 +0100
|
|
Subject: [PATCH 16/28] core-out-of-memory: return EXIT_SUCCESS on --oomable
|
|
option (LP: #1879782)
|
|
|
|
The --oomable flag allows tests to run until they are OOM'd. If they
|
|
died because of being OOM'd then they have run to the expected
|
|
termination point, so return EXIT_SUCCESS.
|
|
|
|
Signed-off-by: Colin Ian King <colin.king@canonical.com>
|
|
---
|
|
core-out-of-memory.c | 9 ++++++++-
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/core-out-of-memory.c b/core-out-of-memory.c
|
|
index 1f397b392f1a..8b44338d9678 100644
|
|
--- a/core-out-of-memory.c
|
|
+++ b/core-out-of-memory.c
|
|
@@ -216,13 +216,20 @@ again:
|
|
|
|
/* If we got killed by OOM killer, re-start */
|
|
if (WTERMSIG(status) == SIGKILL) {
|
|
+ /*
|
|
+ * The --oomable flag was enabled, so
|
|
+ * the behaviour here is to no longer
|
|
+ * retry. The exit return is EXIT_SUCCESS
|
|
+ * because the child is allowed to terminate
|
|
+ * by being OOM'd.
|
|
+ */
|
|
if (g_opt_flags & OPT_FLAGS_OOMABLE) {
|
|
stress_log_system_mem_info();
|
|
pr_dbg("%s: assuming killed by OOM "
|
|
"killer, bailing out "
|
|
"(instance %d)\n",
|
|
args->name, args->instance);
|
|
- return EXIT_NO_RESOURCE;
|
|
+ return EXIT_SUCCESS;
|
|
} else {
|
|
stress_log_system_mem_info();
|
|
pr_dbg("%s: assuming killed by OOM "
|
|
--
|
|
2.21.3
|
|
|