-
Notifications
You must be signed in to change notification settings - Fork 13
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
softIocPVA calls iocInit unrequested and then complains #38
Comments
Just happy that 7.0.4.2 is not out yet... |
The most recent changes to pdbApp/softMain.cpp were 9499137, 8363c87, and e843db5. @ttkorhonen Can you clarify "would break". What Dirk reports sounds like a nuisance message. Are you seeing something more serious? @ralphlange These were all prior to 7.0.4.1 |
This doesn't track. As of 7.0.4.1 these two were in sync. The only subsequent change was to add Can you give any specific examples of a script + CLI arguments which now produce warnings or failures? |
The current logic does not check the return code of Lines 239 to 244 in 0e77203
Don't ask me about the sleep, that had been there for awhile. Probably residual paranoia. |
Maybe "breaks" was not the correct expression but this would be a real nuisance. I use quite often the possibility to stop before iocInit and start manually from the shell. To be honest, I have not tested myself, I just reacted to Dirk's report. |
The message as such is "technically harmless". But not without impact. Users will come to me all the time and ask about that error message thinking they did something wrong. What would "break" might be test setups which expect the ioc to be in an unfinished state so that they can add functionality from the command line (e.g. load more records) before calling iocInit. |
Right, but I don't think this has changed. The |
oops, |
What about -S ? I do not want to prevent an interactive shell. My point is: Before, the user had to write "iocInit" in the startup script. So everyone did it. Now the iocsh complains. To get rid of the message, all startupp scripts need to be changed. I would prefer not to have such unexpected changes of behavior. I do not like programs that try to outsmart me. When call iocInit in my startup script, I mean it. If I don't call iocInit I mean it, too. |
A new command line option that makes softiocPVA call iocInit would be fine. But the default should be not to do it. |
Base 3.15 still has the previous logic, where if (loadedDb) {
iocInit();
epicsThreadSleep(0.2);
} It is entirely possible that handling of the |
Example file startup.cmd:
Command: Before:
Now:
|
Empty startup file: null.cmd
Command: Before:
Now:
|
Hm... I tested now with |
Ok, I see what changed. The order of the two conditions: Lines 222 to 232 in cb13435
Is reversed. So the "Give it the benefit of the doubt..." case is triggered. Lines 224 to 244 in 0e77203
|
It looks to me like the cause of the (my) confusion is that @anjohnson @ralphlange Do either of you know what is going on with Lines 255 to 256 in 0e77203
|
This is the code at the end of /* run user's startup script */
if (argc>0) {
if (iocsh(*argv)) epicsExit(EXIT_FAILURE);
epicsThreadSleep(0.2);
loadedDb = 1; /* Give it the benefit of the doubt... */
}
/* start an interactive shell if it was requested */
if (startIocsh) {
iocsh(NULL);
} else {
if (loadedDb) {
epicsThreadExitMain();
} else {
printf("%s: Nothing to do!\n", arg0);
usage(EXIT_FAILURE);
}
}
epicsExit(EXIT_SUCCESS); If the user loaded at least one database and did not want an interactive iocsh the |
In case it's not obvious, the |
hum. That may have been the intent, but isn't the case with the 3.15 or 7.0 branches at present. And with 3.15 or 7.0, actually passing So it seems like there are some problems with softIoc going back some time. |
Since the logic problems turn out not to be specific to softIocPVA, I'm going to switch back to lp:1904207 (sorry for jumping over here too soon) and make changes softMain.cpp in Base first. Once working, those changes can be sync'd to pva2pva. |
The purpose of the
To exit the IOC I do |
Actually that wasn't quite the tip of the 7.0 branch but close enough, the tip still works but I don't get the verbose output any more:
Note that the IOC doesn't attempt to detach from its parent thread so doing this in a shell results in something that you can't even Ctrl-C or Ctrl-Z out of. If you mean to background it, do that on the command-line. |
Right, but is this really a reasonable way to accomplish this? eg. it seems wrong on windows at least, where return from |
Anyway, since we can agree on the intent I'll replace |
Why not fix the original bug first, preventing softIocPVA from calling iocInit() when it didn't used to. The |
s/didn't used to/softIoc doesnt/ |
Originally reported as https://bugs.launchpad.net/epics-base/+bug/1904207
@dirk-zimoch says:
Since R7.0.4.2, softIocPVA automatically calls iocInit after reading the startup script, even if iocInit had already been called in that script. In that case it complains:
iocBuild: IOC can only be initialized from uninitialized or stopped state
softIoc does not do this only softIocPVA does.
Please revert to the previous behavior which leaves the choice to the user if iocInit should be called or not.
@ttkorhonen says:
+1
This would break a lot of our applications and startup scripts.
The text was updated successfully, but these errors were encountered: