[
https://issues.apache.org/jira/browse/IGNITE-13328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183341#comment-17183341
]
Aleksey Plekhanov commented on IGNITE-13328:
--------------------------------------------
[~ivandasch], currently control.sh and ignite.sh use a loop to run main
process, so it's not correct to fail on any error since there is some logic to
analyze error code and rerun process. But for control.sh this loop is redundant
and can be removed, control utility can't return error code 130, moreover, it
doesn't work somehow with RESTART_SUCCESS_FILE, so this part of control.sh is
also redundant and there are two identical branches of code for {{$INTERACTIVE
== "1"}} condition.
I think current patch is not correct, control.sh still uses a loop, but loop
logic is broken since we will never get error code other than 0 in the script.
Most simple solution to the current problem without breaking the loop logic:
just add {{exit $ERRORCODE}} at the end of the file. Or loop can be removed and
in this case, {{-o errexit}} not needed at all.
Also, I'm not sure about other options, perhaps {{-o nounset}} is helpful, but,
for example, {{-o pipefail}} is redundant for control.sh since pipes don't used
inside this script.
What about other scripts, {{-o errexit}} definitely should not be set for
ignite.sh. In sqlline.sh main process run is the last command in the script, so
{{-o errexit}} is redundant here. ignitevisorcmd.sh should return tty settings
after execution, so it's better to store error code after main process run and
do {{exit $ERRORCODE}} at the end instead of adding {{-o errexit}}.
> Control.sh bash script swallow return code of CommandHandler and always
> return 0
> --------------------------------------------------------------------------------
>
> Key: IGNITE-13328
> URL: https://issues.apache.org/jira/browse/IGNITE-13328
> Project: Ignite
> Issue Type: Bug
> Affects Versions: 2.8, 2.8.1
> Reporter: Ivan Daschinskiy
> Assignee: Ivan Daschinskiy
> Priority: Blocker
> Fix For: 2.9
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> After merging
> [IGNITE-12367|https://issues.apache.org/jira/browse/IGNITE-12367],
> control.sh always return 0, despite the fact that CommandHandler returns
> correct code.
> For example:
> Ignite 2.8.1
> {code}
> Failed to execute baseline command='collect'
> Latest topology update failed.
> Connection to cluster failed. Latest topology update failed.
> Command [BASELINE] finished with code: 2
> Control utility has completed execution at: 2020-08-05T15:01:34.123
> Execution time: 26627 ms
> >>> echo $?
> 0
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)