Hi Tom, Thanks for your reply. To be sure I understand correctly, my executor launches my task. (Which is actually launching a docker container without using the docker containerizer at all. I'm directly communicating with the docker daemon in my executor.) When the task has been launched, I send a status update TASK_RUNNING and the call to the executor returns so that it isn't blocking. Now, I need some way of watching the status of this task outside of mesos (in my case, the task is a docker container) and then, when I see it is done I notify the framework with another status update, e.g. TASK_FINISHED or TASK_FAILED.
I was hoping there was missing something. Even if I was not launching a container but just some other task like a short running app, it seems there's not a way to have Mesos to keep an eye on the tasks' status to tell when/if it completes when using a custom Executor. Instead I need another process to do that. Thanks for your help! Janet -- On Wed, Nov 19, 2014 at 2:29 PM, Tom Arnfeld <[email protected]> wrote: > 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 < > [email protected]> 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 >> >> >> >

