Stop action in progress
-
Scenario: After fulfilling the Trigger conditions, action 1 below starts its path, and stops at the Delay step, waiting for 300 seconds.
In the process of waiting, the Trigger becomes false and action 1 doesn't stop, it follows the countdown, I don't know if it is an error or not, if it shouldn't stop.
The change of the scenario of action 1 to false, triggers another action 2, which has in its step to stop action 1, step 3 below.
But what is happening, is that the stop action is actually putting action 1 on hold, and when action 1 is not completed, action 2 also goes on hold and does not finish in the same way.
Door Kitchen Close is action 1, see that I perform 4 steps out of 6, it is just stopped by the action of the group that is the delay.
Door Kitchen Opened is action 2, which should have stopped action 1, executed two steps, and is stopped at path 3 which is the call to Stop Reaction.
In this scenario, I now have two actions in waiting. To try to stop it, I created a third action that says interrupted, it also goes into waiting.
@toggledbits I didn't open a defect, because I have doubts if I am running the scenario in the correct way or not:
- Should an action in a Delay stage, when having the trigger changed to a false state, stop counting time and not follow the next steps? I think I've read something, when an action is started, it doesn't stop, even if the trigger status is changed, I think it is correct;
- but then I understand that the Stop Action must stop the Delay and in this case force the interruption of the following steps, stop the action at the stage it is at, and terminate any following step.
Comments and suggestions please, if possible the first one on how to stop these actions, because if I do not stop the counting the process works.
Thanks.
-
A rule-based reaction will not stop when the rule triggers/constraints that invoked it become false, unless there is a counter-reaction. This is a documented feature of Reactor (both for Vera and Multi-hub). A counter-reaction is an action that opposes the running reaction. For example, the reset reaction is the counter to the set reaction. If the set reaction starts, but the rule state changes and the reset reaction now needs to be run, the set reaction will be stopped, but only if the reset reaction is not empty. If the reset reaction is empty, the set reaction is allowed to finish.
Also, your screen shots are all too small to see. I don't know if there's been a change to the forum software recently to manage space (by downsizing the images), or if you posted them at that small size/resolution, but they're barely readable, at least not for my old eyes. When I click on them, the forum displays them at the same size that they are in the posting, which isn't useful. It would also be helpful if you included the name of the rule (either as text in the description or as part of the screen shot) so I can tell what screen shot is what rule or reaction. It's not at all clear here, and I can't really respond further because of it. But my suggestion is that you make use of counter-activities if you can, rather than making extra rules and using stops.
-
A rule-based reaction will not stop when the rule triggers/constraints that invoked it become false, unless there is a counter-reaction. This is a documented feature of Reactor (both for Vera and Multi-hub). A counter-reaction is an action that opposes the running reaction. For example, the reset reaction is the counter to the set reaction. If the set reaction starts, but the rule state changes and the reset reaction now needs to be run, the set reaction will be stopped, but only if the reset reaction is not empty. If the reset reaction is empty, the set reaction is allowed to finish.
Also, your screen shots are all too small to see. I don't know if there's been a change to the forum software recently to manage space (by downsizing the images), or if you posted them at that small size/resolution, but they're barely readable, at least not for my old eyes. When I click on them, the forum displays them at the same size that they are in the posting, which isn't useful. It would also be helpful if you included the name of the rule (either as text in the description or as part of the screen shot) so I can tell what screen shot is what rule or reaction. It's not at all clear here, and I can't really respond further because of it. But my suggestion is that you make use of counter-activities if you can, rather than making extra rules and using stops.
@toggledbits Ok first part I understood, very good to understand that if there is no rule in case of reset the action will end. This already helps to improve.
I will try to post the images again.
Image of the first scene - action 1 that stops when the Delay starts within the group.
Action 2 which has in its execution the call to interrupt action 1 that is stopped running the Delay.
As I commented Action 2 when calling 1 does not interrupt the Delay stage and enters waiting, and also Action 1 enters waiting.
I will post again to see if it increases the image.
-
@toggledbits Ok first part I understood, very good to understand that if there is no rule in case of reset the action will end. This already helps to improve.
I will try to post the images again.
Image of the first scene - action 1 that stops when the Delay starts within the group.
Action 2 which has in its execution the call to interrupt action 1 that is stopped running the Delay.
As I commented Action 2 when calling 1 does not interrupt the Delay stage and enters waiting, and also Action 1 enters waiting.
I will post again to see if it increases the image.
-
Update to 21236 and see if that continues. There was an issue stopping child tasks (I noted you had a constraint group in one reaction, and that's a child task).
-
Update to 21236 and see if that continues. There was an issue stopping child tasks (I noted you had a constraint group in one reaction, and that's a child task).
@toggledbits Ok I have already updated the version, but first I have to kill the processes that were in wating, how can I do?
-
Stop Reactor, remove the file
storage/states/reaction_queue.json
, and the start Reactor. -
Stop Reactor, remove the file
storage/states/reaction_queue.json
, and the start Reactor.@toggledbits ok, I removed the file as you explained.
But the new version still didn't solve the problem, I tried again and the Stop Action instruction is not stopping the current counter.
But I see something new, this line that indicates that the action stopped in "delayed".
See the screen print that MSR DISCONNECTED. Even with Ctrl + F5 it didn't come back. I had to stop the service, restart and then come back. Now see that the delayed line no longer appears on the status screen.
I repeated the test again, same result, disconnects the MSR and it is only possible to return by restarting the service, the Stop Reaction instruction does not stop the action that has a delay in progress, and then both are in waiting.
Restart the MSR
-
OK. Let's make sure you followed my instructions to the letter here, because I'm not getting a warm feeling from your description of events.
You have to stop MSR completely first. Not restart. Stop. Full stop.
Then you remove the file
storage/states/reaction_queue.json
from the Reactor install directory.Then you start Reactor again.
When you've done this correctly, there will be no running/waiting/delayed processes in the status view, until you lauch your rules/reactions. But it should come up idle.
-
OK. Let's make sure you followed my instructions to the letter here, because I'm not getting a warm feeling from your description of events.
You have to stop MSR completely first. Not restart. Stop. Full stop.
Then you remove the file
storage/states/reaction_queue.json
from the Reactor install directory.Then you start Reactor again.
When you've done this correctly, there will be no running/waiting/delayed processes in the status view, until you lauch your rules/reactions. But it should come up idle.
@toggledbits correct, I followed your instruction exactly: stop MSR > remove file > star MSR > I executed the actions and it goes back to the waiting status. The instruction that exists in the Door Kitchen Opened action to stop the Door Kitchen Closed action does not happen. But now there is a new situation that is bringing down the MSR. To get it working again, I have to do a Stop > Start in the system.
-
OK, I was able to build a test case that I think duplicates the behavior you are describing. And I was able to find the issue (I opened PR#254 to track it going forward). I will do an updated "latest" build shortly that contains the fix...
-
OK, I was able to build a test case that I think duplicates the behavior you are describing. And I was able to find the issue (I opened PR#254 to track it going forward). I will do an updated "latest" build shortly that contains the fix...
@toggledbits problem solved, already downloaded and tested the version 21237 with the same previous scenario and worked perfect! Once again Super Patrick saves the day! Thanks.
-
Ha! More like Lucky Patrick. But I'll take it. Good bug. Meaty, hard to find, important to find. Thanks for digging it out!
-
T toggledbits locked this topic on