Hello everyone,
I've been thinking about changing how the bodies of if-else and
try-catch-finally are treated by the CLI.
Up until now every control flow block (i.e. between if and else, between
else and end-if, etc) was executed as a batch. So, when a block was
selected for the execution, the CLI would enter the batch mode and
proceed adding operations (and commands translated to operations) to it.
If a command can't be translated to an operation, it would be executed
outside the batch immediately (that's done for commands like cd, ls,
etc). After the last line of the body processed, the batch (if not
empty) is executed.
But this doesn't work when mixing operations with shutdown or reload
commands (they do translate to operations but they have additional logic
related to re-connecting). shutdown/reload will be executed outside the
batch and before the batch is complete.
Currently open issues for this
https://issues.jboss.org/browse/WFCORE-876
https://issues.jboss.org/browse/WFCORE-533
So, I think it was a mistake to execute the bodies of control flow
blocks as batches. It would be better leave them as usual sequences of
command lines and if the user wants a batch, he/she could add batch
command explicitly.
I wanted to ask for opinions. Could we make this change in WildFly 10?
Thanks,
Alexey