Skip to content

Conversation

ddanielr
Copy link
Contributor

@ddanielr ddanielr commented Sep 2, 2025

Adds a try/catch method to handle the IllegalStateException that could be thrown by the lock method.

This handler allows the cleanup operation to run which sets the createdNodeName back to null.

See the commit diff for test behavior before and after the code change.

Added tests for determining if the lock ownership method is working or
getting stuck in a loop when the createdNodeName is null.
Adds a catch statement to the lock method so the createdNodeName entry
is cleaned up after the tryLock hits an illegalStateException and cannot
get out of it.
@ddanielr ddanielr added this to the 2.1.5 milestone Sep 2, 2025
lock(lww, data);
try {
lock(lww, data);
} catch (IllegalStateException e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific throw in the code that this is trying to catch? Seeing a few places that throw this.

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