Skip to content

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

Merged
DomGarguilo merged 2 commits into
apache:mainfrom
DomGarguilo:fixSubShellExit
Sep 17, 2026
Merged

DomGarguilo merged 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?

@ddanielr ddanielr 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.

I'd repoint this to 2.1 and merge it through to main.
The scripts should match between the 2.1 and main branches.

@DomGarguilo

Copy link
Copy Markdown
Member Author

I'd repoint this to 2.1 and merge it through to main. The scripts should match between the 2.1 and main branches.

The bug being fixed here does not exist in 2.1 and was introduced to main in #6091

@ddanielr ddanielr 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.

Ah yeah you're right. The resource groups didn't get added as a config object until after 2.1.

All changes look good!

@DomGarguilo
DomGarguilo merged commit 9011f8b into apache:main Sep 17, 2026
12 of 13 checks passed
@DomGarguilo
DomGarguilo deleted the fixSubShellExit branch September 17, 2026 19:09
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.

3 participants