Skip to content

Properly exit subshell on error in accumulo-cluster script - #6536

Open
DomGarguilo wants to merge 2 commits into
apache:mainfrom
DomGarguilo:fixSubShellExit
Open

DomGarguilo wants to merge 2 commits into
apache:mainfrom
DomGarguilo:fixSubShellExit

Conversation

@DomGarguilo

Copy link
Copy Markdown
Member

For this line:
"$accumulo_cmd" zk info-viewer --print-resource-groups >"$RG_FILE" || (echo "Error getting resource groups. Did you init?" && exit 1)

If the call fails, the error msg prints and exit 1 runs but inside a subshell. So the subshell exits and the script keeps running. That caused the list of resource groups to be empty which made the following check fail saying that "Resource group default does not exist" which may not be true.

This PR fixes things so the subshell exits properly and the script stops where it should. Found 3 total usages of this pattern and fixed them all.

@DomGarguilo DomGarguilo added this to the 4.0.0 milestone Sep 15, 2026
@DomGarguilo DomGarguilo self-assigned this Sep 15, 2026
Comment thread assemble/bin/accumulo-cluster Outdated

@dlmarion dlmarion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this issue exist in 2.1 also?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants