You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2020/04/20 17:53:18 UTC

[mesos] branch master updated: Updated the cgroup listener to not fail on discard.

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

bmahler 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 6bc5a5e  Updated the cgroup listener to not fail on discard.
6bc5a5e is described below

commit 6bc5a5e114077f542f7258adffb78a54849ddf90
Author: Charles-Francois Natali <cf...@gmail.com>
AuthorDate: Mon Apr 20 13:31:26 2020 -0400

    Updated the cgroup listener to not fail on discard.
    
    Before, running any task would cause the following error to be logged
    when the OOM listener was finalized:
    
    E0418 14:13:25.575969 31596 memory.cpp:637] Listening on OOM events
    failed for container 65e9cbb5-2e29-4cac-bc98-2723a359a652:
    Event listener is terminating
    
    The error originates in the OOM listener finalization, which will
    return a failed future even if the listener was terminated due to
    a discard request. The memory subsystem does such a discard during
    cgroup cleanup.
    
    This removes a lot of noise from the logs, which also makes
    debugging a bit easier by avoid following red-herrings.
    
    This closes #359
---
 src/linux/cgroups.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp
index bfc48d6..48be19e 100644
--- a/src/linux/cgroups.cpp
+++ b/src/linux/cgroups.cpp
@@ -1167,7 +1167,11 @@ protected:
     // TODO(chzhcn): Fail our promise only after 'reading' has
     // completed (ready, failed or discarded).
     if (promise.isSome()) {
-      promise.get()->fail("Event listener is terminating");
+      if (promise.get()->future().hasDiscard()) {
+        promise.get()->discard();
+      } else {
+        promise.get()->fail("Event listener is terminating");
+      }
     }
   }