mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiang Yan Xu <...@jxu.me>
Subject Re: Review Request 55887: Check task user before allowing a task to be launched on the agent.
Date Fri, 10 Mar 2017 08:05:16 GMT

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




src/slave/slave.cpp
Line 1807 (original), 1832-1834 (patched)
<https://reviews.apache.org/r/55887/#comment240814>

    As discussed offline, the overall logic about `_run` continuations is probably simpler
if we can pull this out to not conditional on the result of `future` so the method has these
parts
    
    1. Put the task or task group in a common list `tasks`.
    2. Return if the framework is gone.
    3. If the framework is terminating, clean up `tasks` from `framwork->pending` and return.
    4. If some tasks are killed, clean up all `tasks` from `framwork->pending`, send TASK_KILLED
and return.
    5. Check the result of the previous step ...
    
    In fact, step 1-4 should probably be identical for `_run` and `__run` and a good candidate
for refactoring (maybe in a follow up patch).



src/slave/slave.cpp
Lines 1997-2002 (patched)
<https://reviews.apache.org/r/55887/#comment240846>

    This block appears probably too many times and should be extracted out.
    
    ```
    // Return `false` if `task` is not a pending task of this framework.
    bool Framework::removePendingTask(const TaskInfo& task)
    {
      if (framework->pending.contains(task.executor_id()) &&
          framework->pending[task.executor_id()].contains(task.task_id())) {
        framework->pending[task.executor_id()].erase(task.task_id());
        if (framework->pending[task.executor_id()].empty()) {
          framework->pending.erase(task.executor_id());
        }
        return true;
      }
      
      return false;
    }
    ```


- Jiang Yan Xu


On March 8, 2017, 3:17 p.m., Anindya Sinha wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55887/
> -----------------------------------------------------------
> 
> (Updated March 8, 2017, 3:17 p.m.)
> 
> 
> Review request for mesos, Adam B, Anand Mazumdar, Alexander Rojas, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-6953
>     https://issues.apache.org/jira/browse/MESOS-6953
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Added support for action `run_tasks` on the agent's flag `acl`. Based on
> the ACL configured for `run_tasks`, a task to be launched on the agent
> can be (dis)allowed to launch on the agent.
> If a task or task group cannot be launched due to failed authorization,
> a `TASK_ERROR` Status Update shall be sent with a reason code of
> `REASON_TASK_UNAUTHORIZED` or `REASON_TASK_GROUP_UNAUTHORIZED` as
> applicable.
> Note that in case of a task group, all tasks fail if any of the tasks
> within the task group encounter the authorization error.
> 
> 
> Diffs
> -----
> 
>   src/slave/slave.hpp 978edd6309dfbbde1058f9c44d5fac7083ff95fb 
>   src/slave/slave.cpp 4319f841fbdc7ad39eb60eb52ae2a764b133cfbd 
> 
> 
> Diff: https://reviews.apache.org/r/55887/diff/9/
> 
> 
> Testing
> -------
> 
> All tests passed.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>


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