mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Mann <g...@mesosphere.io>
Subject Re: Review Request 70903: Killed all tasks on the agent when draining.
Date Mon, 01 Jul 2019 19:27:37 GMT


> On June 27, 2019, 1:36 p.m., Benjamin Bannier wrote:
> > src/slave/slave.cpp
> > Lines 1005 (patched)
> > <https://reviews.apache.org/r/70903/diff/2/?file=2152205#file2152205line1005>
> >
> >     If we'd just take a `const variant<Task, TaskInfo>&` here we could
remove some noise at the call sites. We could then extra the `kill_policy` inside the lambda
by visiting the respective variant.

I tried this out and I think the `Variant` version is actually a bit noisier and harder to
read. I'm going to drop this issue and leave as-is, since the noise at the callsites here
is pretty minimal (just a ternary operator).


> On June 27, 2019, 1:36 p.m., Benjamin Bannier wrote:
> > src/slave/slave.cpp
> > Lines 1010-1016 (patched)
> > <https://reviews.apache.org/r/70903/diff/2/?file=2152205#file2152205line1010>
> >
> >     What about custom executors? :/
> >     
> >     I feel that in general we shouldn't make assumptions  about what certain executors
are doing, and instead introduce our own agent-specific value (best controllable via a flag).
> >     
> >     While you are working on this block you could immediately initialize `killPolicyGracePeriod`
with the default value, and then possibily overwrite it with the user-provided input.
> >     
> >     Note that with your first conditional we would inject the 3s even if a kill
policy was set (to e.g., be interpreted by a custom executor).

Maybe the following makes sense:
- For the default executor and the command executor, use their default grace period of 3 seconds
when no kill policy was set on the task.
- For the Docker executor and custom executors, use the 'executor_shutdown_grace_period' set
on the agent. This is the default grace period used by the Docker executor, and perhaps also
a reasonable default to assume for custom executors?


> On June 27, 2019, 1:36 p.m., Benjamin Bannier wrote:
> > src/slave/slave.cpp
> > Lines 1043-1046 (patched)
> > <https://reviews.apache.org/r/70903/diff/2/?file=2152205#file2152205line1043>
> >
> >     What do you think about introducing a variable for the kill policy to prevent
this from spanning so many  lines?
> >     
> >     Here and below.

Assigning the task kill policy to a local variable also ends up taking up several lines...
I think I prefer this form, so I'm going to drop this issue for now.


- Greg


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70903/#review216192
-----------------------------------------------------------


On June 25, 2019, 8:12 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70903/
> -----------------------------------------------------------
> 
> (Updated June 25, 2019, 8:12 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benno Evers, Benjamin Mahler, and Joseph
Wu.
> 
> 
> Bugs: MESOS-9821
>     https://issues.apache.org/jira/browse/MESOS-9821
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch updates the agent's `DrainSlaveMessage` handler
> to kill all tasks on the agent when the message is received.
> 
> 
> Diffs
> -----
> 
>   include/mesos/type_utils.hpp 57b1893160dbe874aa9fec00a3d1b640b9c54906 
>   src/slave/slave.cpp 30039b0857a4d85b4b96fa95d7f8724d57cdec6e 
> 
> 
> Diff: https://reviews.apache.org/r/70903/diff/2/
> 
> 
> Testing
> -------
> 
> Testing details at the end of this chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message