Skip to content

Avoid putting the MAC JVM in server mode when setting goal state - #6590

Merged
DomGarguilo merged 1 commit into
apache:2.1from
DomGarguilo:fixServerMode
Oct 16, 2026
Merged

DomGarguilo merged 1 commit into
apache:2.1from
DomGarguilo:fixServerMode

Conversation

@DomGarguilo

Copy link
Copy Markdown
Member

#6582 had a side affect which caused AccumuloClientIT.testClose and CleanUpIT to fail. This was because the SingletonManager was being switched to server mode because MAC start() was creating a ServerContext. Server mode makes it so that client resources are no longer cleaned up when the last client closes

The fix for this was to change how we set the manager goal state. Building a ZooReaderWriter directly instead of using the one off a ServerContext. I updated the helper method SetGoalState.setGoalState to accept ZRW as a param instead so MAC and main() still share it.

The var reservation = SingletonManager.getClientReservation() was added to protect a case I noticed while looking at the singleton code. Now that we are staying in client mode, the zookeeper sessions are shut down when no client is open, so if a MAC starts after the last client was closed, it would fail. I don't thing any of our ITs hit this case but other MAC usage could.

@DomGarguilo DomGarguilo added this to the 2.1.7 milestone Oct 15, 2026
@DomGarguilo DomGarguilo self-assigned this Oct 15, 2026

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

Looks good to me. I always get confused about the SingletonManager.

@DomGarguilo
DomGarguilo merged commit 38360f5 into apache:2.1 Oct 16, 2026
9 checks passed
@DomGarguilo
DomGarguilo deleted the fixServerMode branch October 16, 2026 14:00
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.

4 participants