Re-using Task IDs is definitely not encouraged. As far as I know, many of
the Mesos code assume Task ID is unique. So I probably won't risk that.


On Fri, Jul 10, 2015 at 10:06 AM, 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?
>

Reply via email to