You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gi...@apache.org on 2019/01/08 00:16:42 UTC

[mesos] branch master updated: Sent SIGKILL to I/O switchboard server as a safeguard.

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

gilbert 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 3478e34  Sent SIGKILL to I/O switchboard server as a safeguard.
3478e34 is described below

commit 3478e344fb77d931f6122980c6e94cd3913c441d
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Mon Jan 7 16:16:12 2019 -0800

    Sent SIGKILL to I/O switchboard server as a safeguard.
    
    Review: https://reviews.apache.org/r/69667/
---
 src/slave/containerizer/mesos/io/switchboard.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index c445a8f..8e02e51 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -814,6 +814,23 @@ Future<Nothing> IOSwitchboard::cleanup(
                   << " is being destroyed";
 
         os::kill(pid.get(), SIGTERM);
+
+        Clock::timer(Seconds(60), [pid, status, containerId]() {
+          if (status.isPending()) {
+            // If we are here, something really bad must have happened for I/O
+            // switchboard server to not exit after SIGTERM has been sent. We
+            // have seen this happen due to FD leak (see MESOS-9502). We do a
+            // SIGKILL here as a safeguard so that switchboard server forcefully
+            // exits and causes this cleanup feature to be completed, thus
+            // unblocking the container's cleanup.
+            LOG(ERROR) << "Sending SIGKILL to I/O switchboard server (pid: "
+                       << pid.get() << ") for container " << containerId
+                       << " since the I/O switchboard server did not terminate "
+                       << "60 seconds after SIGTERM was sent to it";
+
+            os::kill(pid.get(), SIGKILL);
+          }
+        });
       }
     });
   }