I am doing a similar thing, where I have a process which spawns up a fixed
set of tasks, each assigned to a specific period of work, so each task
name is constant, and if a task fails another is restarted with the same
name. So I think this approach should work fine.

On 7/10/15, 1:06 PM, "Sargun Dhillon" <[email protected]> wrote:

>Is reusing Task IDs good behaviour? Let's say that I have some
>singleton task - I'll call it a monitoring service. It's always going
>to be the same process, doing the same thing, and there will only ever
>be one around (per instance of a framework). Reading the protobuf doc,
>I learned this:
>
>
>/**
> * A framework generated ID to distinguish a task. The ID must remain
> * unique while the task is active. However, a framework can reuse an
> * ID _only_ if a previous task with the same ID has reached a
> * terminal state (e.g., TASK_FINISHED, TASK_LOST, TASK_KILLED, etc.).
> */
>message TaskID {
>  required string value = 1;
>}
>---
>Which makes me think that it's reasonable to just give this task the
>same taskID, and that every time I bring it from a terminal status to
>running once more, I can reuse the same ID. This also gives me the
>benefit of being able to more easily locate the task for a given
>framework, and I'm able to exploit Mesos for some weak guarantees
>saying there wont be multiple of these running (don't worry, they lock
>in Zookeeper, and concurrent runs don't do anything, they just fail).
>
>Opinions?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to