This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 6bb60a4  Reverted the changes about 
`REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED`.
6bb60a4 is described below

commit 6bb60a4869394f663a09370016127ae8688cbe06
Author: Qian Zhang <[email protected]>
AuthorDate: Mon Apr 27 22:34:51 2020 +0800

    Reverted the changes about `REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED`.
    
    The method `MemorySubsystemProcess::oomWaited()` will only be invoked when 
the
    container is OOM killed because it uses more memory than its hard memory 
limit
    (i.e., the task status reason `REASON_CONTAINER_LIMITATION_MEMORY`), it will
    NOT be invoked when a burstable container is OOM killed because the agent 
host
    is running out of memory, i.e., we will NOT receive OOM killing notification
    via cgroups notification API for this case. So it is not possible for Mesos 
to
    provide a task status reason `REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED` for 
this
    case.
    
    Review: https://reviews.apache.org/r/72442
---
 include/mesos/mesos.proto                          |  1 -
 include/mesos/v1/mesos.proto                       |  1 -
 src/common/protobuf_utils.cpp                      |  3 +--
 .../mesos/isolators/cgroups/subsystems/memory.cpp  | 24 +---------------------
 4 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 9412ed7..470343c 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -2643,7 +2643,6 @@ message TaskStatus {
     REASON_CONTAINER_LIMITATION = 19;
     REASON_CONTAINER_LIMITATION_DISK = 20;
     REASON_CONTAINER_LIMITATION_MEMORY = 8;
-    REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED = 35;
     REASON_CONTAINER_PREEMPTED = 17;
     REASON_CONTAINER_UPDATE_FAILED = 22;
     REASON_MAX_COMPLETION_TIME_REACHED = 33;
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 194c42c..ecf717a 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -2632,7 +2632,6 @@ message TaskStatus {
     REASON_CONTAINER_LIMITATION = 19;
     REASON_CONTAINER_LIMITATION_DISK = 20;
     REASON_CONTAINER_LIMITATION_MEMORY = 8;
-    REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED = 35;
     REASON_CONTAINER_PREEMPTED = 17;
     REASON_CONTAINER_UPDATE_FAILED = 22;
     REASON_MAX_COMPLETION_TIME_REACHED = 33;
diff --git a/src/common/protobuf_utils.cpp b/src/common/protobuf_utils.cpp
index 8d1d5c4..723d85a 100644
--- a/src/common/protobuf_utils.cpp
+++ b/src/common/protobuf_utils.cpp
@@ -254,8 +254,7 @@ StatusUpdate createStatusUpdate(
     CHECK(
         reason.get() == TaskStatus::REASON_CONTAINER_LIMITATION ||
         reason.get() == TaskStatus::REASON_CONTAINER_LIMITATION_DISK ||
-        reason.get() == TaskStatus::REASON_CONTAINER_LIMITATION_MEMORY ||
-        reason.get() == TaskStatus::REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED)
+        reason.get() == TaskStatus::REASON_CONTAINER_LIMITATION_MEMORY)
       << reason.get();
 
     status->mutable_limitation()->mutable_resources()->CopyFrom(
diff --git 
a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp 
b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
index 60c7a89..15f87ba 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
@@ -699,33 +699,11 @@ void MemorySubsystemProcess::oomWaited(
         ? (double) usage->bytes() / Bytes::MEGABYTES : 0),
       "*").get();
 
-  TaskStatus::Reason reason = TaskStatus::REASON_CONTAINER_LIMITATION_MEMORY;
-
-  // If the container has a hard limit set higher than the soft limit, then
-  // check if the memory usage is above the soft limit but less than the hard
-  // limit. If so, we send a task status reason to the scheduler which 
indicates
-  // that this container was preferentially OOM-killed because it exceeded its
-  // memory request without hitting its memory limit.
-  Try<Bytes> softLimit =
-    cgroups::memory::soft_limit_in_bytes(hierarchy, cgroup);
-
-  if (softLimit.isError()) {
-    LOG(ERROR) << "Failed to read 'memory.soft_limit_in_bytes': "
-               << softLimit.error();
-  } else if (softLimit.get() < limit.get()) {
-    if (!usage.isError() &&
-        !limit.isError() &&
-        usage.get() > softLimit.get() &&
-        usage.get() < limit.get()) {
-      reason = TaskStatus::REASON_CONTAINER_MEMORY_REQUEST_EXCEEDED;
-    }
-  }
-
   infos[containerId]->limitation.set(
       protobuf::slave::createContainerLimitation(
           mem,
           message.str(),
-          reason));
+          TaskStatus::REASON_CONTAINER_LIMITATION_MEMORY));
 }
 
 

Reply via email to