question

jacopo-r avatar image
0 Likes"
jacopo-r asked jacopo-r commented

Preempting and aborting task not working properly

Hello,

In the attached model I tried to replicate an issue I am facing when trying to aborting all task on a task executer.
There are task 1 (got to base), task 2 and task 3 in the following order: 1 - 2 - 1 - 3.
Task 1 is a "do not wait until completed" while task 2 and 3 should abort all tasks. When running the model, the first time, task 1 is aborted and the operator directly perform task 2, while the second time, the task 1 is not aborted, so the operator goes to base and then perform task 3.

1720090091771.png

Can anyone explain me why?

I have also noticed that if I stop the model before the operator reaches plane 2 (namely completing task 2) and I continue the model using the "step" button, then this problem does not occur and the operator goes from task 2 to task 3, skipping task 1 as desired. I understand this seems a computational/process order issue, but I could not find a solution.


Thank you in advance.


AbortingTask_test.fsm


FlexSim 24.0.1
abort taskpreempt task
1720090091771.png (119.4 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered jacopo-r commented

i replicated the situation in code to demonstrate what happens. The main 'issue' is that while the task sequence to move to Plane2 has finished it still exists when the new task sequences are created.

So both of those go into the task sequence queue. When the preempting task sequence is dispatched it does not override the still existing TS because they have the same priority and preempt setting. Since the task sequence was not started, the other task is also not aborted.

Afterwards, when the previous task sequence is actually removed (in the video this happens when the operator arrives at Plane3 in your model it happens instantly), the two sequences in the queue are pulled based on their priority. Since they both have the same priority, the one that was created first is started.

To fix this, place a Breathe activity (0s delay) ahead of the final Run Sub Flow activity, so that the original task sequence does not exist anymore when the next preempting TS is dispatched. Or increase the priority of the preempting task sequence above that of the non-preempting one.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

jacopo-r avatar image jacopo-r commented ·
Thank you @Felix Möhlmann
0 Likes 0 ·