Hi,

If the master leaves, tasks will still continue to execute.
If your tasks need to be aware of the master state you should implement
ComputeJobMasterLeaveAware interface.

Considering the case I see two ways:

1) Put the task state into a cache where the key is task id and the value
is task state.
Periodically scan the cache for completed tasks and do cleanup.
This is similar to your solution.
Service API is not required but can be used.

2) Subscribe to TaskEvent s
The flaw of this solution is what event not guaranteed to be delivered if
the listener dies.



2016-05-06 15:16 GMT+03:00 djm132 <[email protected]>:

> Thanks for clarification.
>
> So if the originator dies - all started tasks dies too, right?
>
> In this case I see solution like this:
>
> 1) Create task on initiator node.
> 2) Put node id + task data to ignite cache.
> 3) Create service which returns task liveness/status/result for taskId
> originated locally.
> 4) Create recurring job on every node which looks in cache and for every
> task found checks liveness of task. Then in case of error just fire task
> again.
> 5) When API asks for task state it looks to cache for taskId, finds node
> and
> ask it via service. Then cache cleared if task completed.
>
> May be there is better way to do it ?
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Async-workers-tp4813p4829.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 

Best regards,
Alexei Scherbakov

Reply via email to