Hi Bernerd, In Marathon's case there are a couple of things in place to ensure reliable launching. Marathon tracks tasks via the Mesos state abstraction (backed by ZK) so it can recover after getting disconnected. It only considers a task running after it received a TASK_RUNNING from Mesos: https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/MarathonScheduler.scala#L107-L109
To avoid the TASK_LOST + TASK_RUNNING problem you described, Marathon adds a timestamp to all task IDs: https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/tasks/TaskIDUtil.scala#L16 Hope this helps! Tobi On Wed, Sep 18, 2013 at 4:58 AM, Bernerd Schaefer <[email protected]>wrote: > > 1) When my Framework has need to launch a job it calls >> Scheduler.launchTask. But at this point it does not actually run any jobs. >> If the launchTask returns successfully my Framework assumes at that point >> that it has "control" over the resources and that the executor is ready to >> run jobs. >> >> 2) I then pass the mesos slave/executor details to my internal job >> framework and when ready I use Scheduler.sendFrameworkMessage() to actually >> run my job after my internal scheduler does the setup work. >> >> 3) If step #2 fails for any reason, my Framework assumes the >> slave/executor is no longer available and submits another request and waits >> for Framework to find another match. >> > > Given that neither launchTask nor sendFrameworkMessage offer reliable > delivery, how do you detect failure? Timeouts? Something else? > > Bernerd > Engineer @ Soundcloud >

