You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Guangya Liu (JIRA)" <ji...@apache.org> on 2015/12/16 16:11:46 UTC

[jira] [Commented] (MESOS-3891) Add a helper function to the Agent to check available resources before launching a task.

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

Guangya Liu commented on MESOS-3891:
------------------------------------


Adding a queue to slave to queue all of the tasks related to allocation slack. The reason that we need this queue is because the task launch related with the allocation slack may trigger executor eviction and the eviction may take some time. Adding a queue here can make sure other tasks without allocation slack will not be delayed when the previous tasks related with allocation slack are evicting tasks.

Adding a queue can also help resolve the race condition issue: All of the tasks in the queue will be handled with FCFS policy.

{code}
_runTask() {
  ...
  if (!Resources(task.resources()).allocSlackRevocable().empty()) {
     // Put task to pending queue.
  }
 
 if (!Resources(task.resources()).stateless().reserved.empty()) {
     // Put task to pending queue.
  }
  ...
  // Handle other tasks.
}
{code}

> Add a helper function to the Agent to check available resources before launching a task. 
> -----------------------------------------------------------------------------------------
>
>                 Key: MESOS-3891
>                 URL: https://issues.apache.org/jira/browse/MESOS-3891
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Artem Harutyunyan
>            Assignee: Guangya Liu
>              Labels: mesosphere
>
> Launching a task using revocable resources should be funnelled through an accounting system:
> * If a task is launched using revocable resources, the resources must not be in use when launching the task.  If they are in use, then the task should fail to start.
> * If a task is launched using reserved resources, the resources must be made available.  This means potentially evicting tasks which are using revocable resources.
> Both cases could be implemented by adding a check in Slave::runTask, like a new helper method:
> {noformat}
> class Slave {
>   ...
>   // Checks if the given resources are available (i.e. not utilized)
>   // for starting a task.  If not, the task should either fail to
>   // start or result in the eviction of revocable resources.
>   virtual process::Future<bool> checkAvailableResources(
>       const Resources& resources);
>   ...
> }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)