You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Qian Zhang (JIRA)" <ji...@apache.org> on 2017/08/30 23:42:01 UTC

[jira] [Comment Edited] (MESOS-7926) Abnormal termination of default executor can cause MesosContainerizer::destroy to fail.

    [ https://issues.apache.org/jira/browse/MESOS-7926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16146904#comment-16146904 ] 

Qian Zhang edited comment on MESOS-7926 at 8/30/17 11:41 PM:
-------------------------------------------------------------

[~jieyu], [~benjaminhindman], I think it is the code [here|https://github.com/apache/mesos/blob/1.4.0-rc3/3rdparty/libprocess/include/process/future.hpp#L1413:L1414] to propagate the discard caused by the broken libprocess connection ({{WAIT_NESTED_CONTAINER}}) to {{Container.termination.future()}} and make it discarded as well.
{code}
  // Propagate discarding up the chain. To avoid cyclic dependencies,
  // we keep a weak future in the callback.
  promise->future().onDiscard(
      lambda::bind(&internal::discard<T>, WeakFuture<T>(*this)));
{code}
I am a bit confused why we need to propagate discarding *up* the chain, letting the downstream future affect the upstream future seems a bit strange.


was (Author: qianzhang):
I think it is the code [here|https://github.com/apache/mesos/blob/1.4.0-rc3/3rdparty/libprocess/include/process/future.hpp#L1413:L1414] to propagate the discard caused by the broken libprocess connection ({{WAIT_NESTED_CONTAINER}}) to {{Container.termination.future()}} and make it discarded as well.
{code}
  // Propagate discarding up the chain. To avoid cyclic dependencies,
  // we keep a weak future in the callback.
  promise->future().onDiscard(
      lambda::bind(&internal::discard<T>, WeakFuture<T>(*this)));
{code}
I am a bit confused why we need to propagate discarding *up* the chain, letting the downstream future affect the upstream future seems a bit strange.

> Abnormal termination of default executor can cause MesosContainerizer::destroy to fail. 
> ----------------------------------------------------------------------------------------
>
>                 Key: MESOS-7926
>                 URL: https://issues.apache.org/jira/browse/MESOS-7926
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 1.2.2, 1.3.1, 1.4.0
>            Reporter: Jie Yu
>            Priority: Critical
>
> This is the sequence of events:
> 1) Default executor launches a nested container
> 2) Default executor invokes agent API WAIT_NESTED_CONTAINER
> 3) Default executor is killed
> 4) The connection to the agent for WAIT_NESTED_CONTAINER breaks
> 5) libprocess discard the future, which propagates to the code [here|https://github.com/apache/mesos/blob/1.4.0-rc3/src/slave/containerizer/mesos/containerizer.cpp#L1955-L1956].
> 6) `termination.future()` has the discard flag being set to true (i.e., hasDiscard() == true).
> 7) Default executor termination triggers container destroy for the nested container
> 8) When the destroy of the nested container is done, the control will reach [here|https://github.com/apache/mesos/blob/1.4.0-rc3/src/slave/containerizer/mesos/containerizer.cpp#L2176-L2177].
> 9) In the [thenf|https://github.com/apache/mesos/blob/1.4.0-rc3/3rdparty/libprocess/include/process/future.hpp#L1299-L1301] handler for 'termination.future()', since `termination.future()` has discard flag set (hasDiscard() == true), we'll call promise->discard(), which cause the returned future to be in DISCARDED state.
> 10) The top level container destroy will fail because nested container destroy failed
> 11) This cause all isolator cleanup for the top level container not being called (e.g., CNI detach).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)