mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Wu <jos...@mesosphere.io>
Subject Re: Review Request 70899: Refactored the agent's task-killing code.
Date Tue, 02 Jul 2019 22:48:54 GMT


> On June 27, 2019, 6:02 a.m., Benjamin Bannier wrote:
> > src/slave/slave.cpp
> > Lines 3755-3757 (original), 3787-3789 (patched)
> > <https://reviews.apache.org/r/70899/diff/3/?file=2151692#file2151692line3794>
> >
> >     The `CHECK` for `TERMINATING` here does not fit the branch on `TERMINATING`
below, and one of them should be removed.
> 
> Greg Mann wrote:
>     I don't understand - the switch statement below is for the executor state, and I
think this block _does_ make sense with respect to the conditional below for `framework->state
== Framework::TERMINATING`. I'll ask Joseph to take a look at this as well, but dropping this
issue for now.

I think what could be done is this: 
```
void Slave::kill(...)
{
  // ...
  CHECK_NOTNULL(framework);
  CHECK_NOTNULL(executor);
  
  // We don't send a status update here because a terminating
  // framework cannot send acknowledgements.
  if (framework->state == Framework::TERMINATING) {
    LOG(WARNING) << "Ignoring kill task " << taskId
                 << " of framework " << frameworkId
                 << " because the framework is terminating";
    return;
  }
  
  CHECK(framework->state == Framework::RUNNING)
    << framework->state;
    
  ...
```


- Joseph


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


On July 1, 2019, 12:49 p.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70899/
> -----------------------------------------------------------
> 
> (Updated July 1, 2019, 12:49 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 factors the code responsible for killing tasks
> out into two helper functions. This will facilitate the
> calling of this common code by the agent-draining handler.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 6954f53ff1531b9fcb688ef76acddf6a3d849a41 
>   src/slave/slave.cpp 30039b0857a4d85b4b96fa95d7f8724d57cdec6e 
> 
> 
> Diff: https://reviews.apache.org/r/70899/diff/4/
> 
> 
> Testing
> -------
> 
> Testing details at the end of this chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


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