-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanly exit IOC when stopping IOC execution #2
Comments
This sounds like a useful addition, I never added it because of the complexity of having to work out if the exit had succeeded and CTRL-X it if it didn't. Can you think of a way to do this? Happy to accept a PR for this behaviour. |
My thinking is that we could have a timeout PV rather than any positive
acknowledgement of exit success. If the timeout PV value is 0, the current
behavior is in charge, otherwise emit exit() to the IOC shell, wait out the
timeout, and then bang CTRL-X.
One thing I haven't worked out is how we can emit characters to the IOC
shell from the .st file.....not sure if printf() would be the best
mechanism for that, or is there something more clever.
…On Mon, Dec 19, 2022 at 4:47 AM Tom C (DLS) ***@***.***> wrote:
This sounds like a useful addition, I never added it because of the
complexity of having to work out if the exit had succeeded and CTRL-X it if
it didn't. Can you think of a way to do this? Happy to accept a PR for this
behaviour.
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4GYYLMNL6WIMHZ5OJ72GLWOAVLDANCNFSM6AAAAAATBIUQKE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The only issue with this approach is that exit() will cause the IOC to restart if auto-restart is on, so we'd have to detect if it restarted during the timeout so we didn't double restart it
You can do something like https://github.com/dls-controls/procServControl/blob/fb8423c4fc6d51f1ce3954f88aa13fe800fc8ae6/procServControlApp/src/procServControl.st#L343-L360 |
Currently, stopping an IOC only terminates the IOC process, but does not allow for that IOC to gracefully shutdown. In some cases, it would be preferable to issue the 'exit()' command at the EPICS shell prior to forcefully terminating the process.
In my experience this is necessary for certain IOCs which are controlling hardware, e.g. camera hardware. I have a concrete example of a failure we experience at SNS. A camera IOC makes a connection to the SDK/API supplied as a shared library by the camera vendor (ANDOR). If the connection is not closed properly, the next attempt to connect to the camera will fail. Issuing the exit() command at the EPICS shell would allow the opportunity for the IOC to 'clean up' by closing the camera instance properly via the vendor API.
The text was updated successfully, but these errors were encountered: