Shutting down module

Hi,

When my gateway module is shut down (due to say an abnormal termination like an exception or a scheduled shutdown such as completion of its assigned task), the Ignition dash board still shows module status as “Running”!This is misleading to the user! How to make it show status as “stopped” or something like that to indicate correct status so that user can restart module if required?

Also I would appreciate your comments on my post on “memory leaks”. Or if someone could give me some references to java where I can understand the how garbage collection mechanism works in JAVA for even trivial situations like garbage collection while strings are reassignment in a repeated cyclic loop.

PRAMANJ

Modules don’t shut down on their own. You may be done doing work, or you may have encountered an error, but unless you error out during startup you’re in the RUNNING state.

The exception to this is modules that don’t have a gateway hook - they don’t have a RUNNING state and instead go into the LOADED state.

If exception is caught during execution of an execution manager thread which is looping cyclically then how do I error out on catching the exception? Once the status is shown as not-running then user can restart the module, that was my requirement.
regards
PRAMANJ

That’s not how the module lifecycle works. You’ll have to figure out some other way to notify the user the module needs to be restarted.

That being said… the idea that you expect something to go wrong, that you can’t recover, and that the user then needs to restart the module, is not a good idea.

Hi Kevin,
Thanks a lot for your clear explanation. Modules are not supposed to terminate, they should do their job and wait for the next loop or instruction. In my case I need to reinitialize a few things in certain rare exceptional cases when I have no choice but to restart my module. This violates the fundamental premise that modules should not terminate. So I will figure out some mechanism to inform user that he needs to restart module.

Any comments on my memory leaks post few days ago? I am worried that continuous buffer reassignment and use of methods that return a list which I assign to local list in a continuous cyclic manner shouldn’t accumulate freed memory and cause memory leaks and show up after a long period of time! Or am I being paranoid about it? Will garbage collector take care of it efficiently? JAVA make developers life easier by doing things automatically, but when we don’t know what is happening under the hood we feel unsafe especially when the errors are not immediately visible in a continuously running application like Ignition! Is there any compiler time option that can indicate such errors or warnings?

Best Regards
PRAMANJ