17301: Shorted OOM message. Limit added detail to 40 lines.
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 21 Apr 2022 18:16:49 +0000 (14:16 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 21 Apr 2022 18:16:49 +0000 (14:16 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

sdk/cwl/arvados_cwl/arvcontainer.py
sdk/cwl/arvados_cwl/executor.py
sdk/cwl/tests/test_container.py

index b04fb190e963e965524679bb4473767820e8b849..f75bde81e6cebd655a8378fbd382f18b3bf18d2f 100644 (file)
@@ -394,7 +394,7 @@ class ArvadosContainer(JobBase):
                     processStatus = "permanentFail"
 
                 if rcode == 137:
-                    logger.warning("%s This container was killed on the compute instance.  The most common reason is that it attempted to allocate too much RAM and was targeted by the Out Of Memory (OOM) killer.  Try resubmitting with a higher 'ramMin'.",
+                    logger.warning("%s Container may have been killed for using too much RAM.  Try resubmitting with a higher 'ramMin'.",
                                  self.arvrunner.label(self))
             else:
                 processStatus = "permanentFail"
index 6cc971afa7f6076bd3538bdb5bc127b8a5289a0f..680ca0b7b2c85df6b2f7d55709205b47ad591ef7 100644 (file)
@@ -261,19 +261,25 @@ The 'jobs' API is no longer supported.
             if current is None:
                 return
             runtime_status = current.get('runtime_status', {})
-            # In case of status being an error, only report the first one.
-            if kind in ('error', 'warning', 'activity'):
+            if kind in ('error', 'warning'):
                 updatemessage = runtime_status.get(kind, "")
                 if not updatemessage:
-                    updatemessage = message;
+                    updatemessage = message
 
                 # Subsequent messages tacked on in detail
                 updatedetail = runtime_status.get(kind+'Detail', "")
-                if updatedetail:
-                    updatedetail += "\n"
-                updatedetail += message + "\n"
-                if detail:
-                    updatedetail += detail + "\n"
+                maxlines = 40
+                if updatedetail.count("\n") < maxlines:
+                    if updatedetail:
+                        updatedetail += "\n"
+                    updatedetail += message + "\n"
+
+                    if detail:
+                        updatedetail += detail + "\n"
+
+                    if updatedetail.count("\n") >= maxlines:
+                        updatedetail += "\nSome messages may have been omitted.  Check the full log."
+
                 runtime_status.update({
                     kind: updatemessage,
                     kind+'Detail': updatedetail,
index 798c5af289322ce2ae23edc26ca7d8a863d50186..4d87d27e6e564147d4862b3445a7667fe21593a4 100644 (file)
@@ -1385,6 +1385,8 @@ class TestWorkflow(unittest.TestCase):
         runner.api.collections().list().execute.return_value = {"items": [{"uuid": "zzzzz-4zz18-zzzzzzzzzzzzzzz",
                                                                            "portable_data_hash": "99999999999999999999999999999993+99"}]}
 
+        runner.api.containers().current().execute.return_value = {}
+
         runner.project_uuid = "zzzzz-8i9sb-zzzzzzzzzzzzzzz"
         runner.ignore_docker_for_reuse = False
         runner.num_retries = 0