Hi Janet,



Great to hear you're using Mesos! It's not the best idea to block in callbacks 
from the mesos drivers, either in the Executor or Framework, this is because 
you won't be notified correctly when other events happen (master failover, 
shutdown request, kill task request) as I believe the driver will guarantee you 
only get one callback at once and uses a blocking call into userland code.




The slave and master become aware of task status by the executor correctly 
sending the TaskStatus message with TASK_STARTING, TASK_RUNNING, TASK_LOST, 
TASK_FAILED and TASK_FINISHED.




Your executor is guaranteed to be alive for your task to be alive (unless there 
are any failures cases i'm not aware of) so you it's easier to monitor your 
task from the outside (if it's a subprocess, for example). Your use of the 
docker containerizer will also contribute to this behaviour as the mesos slave 
is going to kill the container ASAP after the executor disconnects.




Sending task status updates should do the trick for you here.




Tom.


--


Tom Arnfeld

Developer // DueDil





(+44) 7525940046

25 Christopher Street, London, EC2A 2BS

On Wed, Nov 19, 2014 at 10:16 PM, Janet Borschowa
<janet.borsch...@codefutures.com> wrote:

> Hi,
> I'm implementing an executor which is used by the mesos slave to launch
> tasks. The tasks are to launch a docker container - this is because I need
> more info about the launched container than what the docker containerizer
> returns.
> Is it OK to block in the executor's launchTask method until the task
> completes? If not, how does the framework discover when that task
> completes? I could spawn a process which notifies my executor when the task
> completes and then have my executor send a status update. Or is there some
> other recommended way to deal with this when the task could run for an
> indefinite period of time before completing its work?
> Thanks!
> Janet
> --
> Janet Borschowa
> CodeFutures Corporation

Reply via email to