04-13-2015 05:55 AM
Hi again,
Having implemented "verified stop" in my program, and tested it, it works perfectly in the dev environment. My verified stop goes as follows:
Send "StopProgram" to controller
Controller sends stop to plugins and monitors active plugin array
Handle last ack core removes the plugin enqueuer from the active plugin array
when plugin array size=0 controller sends stop to self.
(I haven't implemented a "shutting down" flag yet)
The program writes to a log file for debugging. In the dev environment, everything works great. Log file shows controller sending plugin the stop, receiving the last ack, and exiting. When compiled, it never receives the last ack (never enters handle last ack core).
Is this another bug fixed by the f2 patch? Is there another reason why it isn't receiving the last ack once compiled?
Thanks,
Danielle
Solved! Go to Solution.
04-14-2015 03:12 AM
Hi,
I have discovered that it sometimes doesn't receive last ack in dev environment either. I have not been able to find a pattern.
My plugins have the same parent as the framework actors, it is a PPL version of AF (which is why I haven't done the f2 patch yet, I would have to recompile all the PPLs in the hierarchy). Other messages pass fine both to the plugin and back.
From what I understood, the f2 patch shouldn't affect this at all. Is there another reason for a caller not to receive the last ack?
Thanks,
Danielle
04-21-2015 12:48 PM
Danielle,
I am seeing this in my development environment as well, and it seems itermittent. The Last Ack funtion was working on some other code I developed and now it doesnt seem to work. Not sure what thats all about.
Have you made any discoveries since last week?
-Steven
04-21-2015 01:08 PM
Danielle,
Some more information for you.
I noticed that when I have one Actor launch a Nested Actor and you the shutdown the caller actor and it therefore shutsdown its nested actors, you dont get a Last Ack back from the Nested Actors during this scenario, at least I dont.
If I invoke a Shutdown Nested Actor Method via a Message to the Caller Core (Method reads Nested Actors NQR, then sends it a Stop Core Msg), then I do get a Last Ack back from the Nested Actor.
-Steven
04-21-2015 02:19 PM
StevenHowell_XOM wrote:
I noticed that when I have one Actor launch a Nested Actor and you the shutdown the caller actor and it therefore shutsdown its nested actors, you dont get a Last Ack back from the Nested Actors during this scenario, at least I dont.
This is correct, expected behavior.
If you send Stop to an actor, it is going to stop. It isn't going to handle any further messages. It will pass the Stop message along to its nested actors but won't wait to see what they do with it.
If you want a controlled shutdown, do not send Stop to the caller actor. Instead, send your own message "Controlled Stop" or something like that. Then in your code, do whatever you need to do to put the actor in a safe mode such that you can send the Controlled Stop to your nested actors and then continue to wait for Ack messages but also send out errors for any other messages that arrive ("cannot handle; actor already stopping") in the meantime.
I have discussed in the forums trying to create a controlled shutdown state as part of the AF itself, but did not get a whole lot of feedback on the issue, and the code for which messages to continue to handle seems to be strongly application/actor specific, leaving me unsure about making it a first-class part of the AF.
04-21-2015 02:21 PM
The thread I started for discussing this is here:
04-21-2015 02:24 PM
Thanks for the confirmation AQ, I suspected it was inherent behavior written into the framework, but I wasnt 100% sure.
Thank you as well for the suggestions. I currently do not have a need for the controlled shutdown, but that might be useful in the future.
I saw Danielle's post and remembered I had seen similar behavior, wanted to add my 2 cents.
04-22-2015 10:51 AM
Hi,
Thanks for adding your information.
However, this is not the behaviuor I was seeing. In my case, a calling actor would launch nested actors, they would stop by themselves, and the caller would not receive a last ack. It might have been connected to my other problems here.
I created my own "module stopped" message and it works fine.
Thanks,
Danielle