Skip to content

CURATOR-676: Notify CuratorListener for retriable errors when no callback specified - #1300

Open
waterWang wants to merge 1 commit into
apache:masterfrom
waterWang:master
Open

CURATOR-676: Notify CuratorListener for retriable errors when no callback specified#1300
waterWang wants to merge 1 commit into
apache:masterfrom
waterWang:master

Conversation

@waterWang

Copy link
Copy Markdown

Description

When abortOperation is called for a retriable error and no BackgroundCallback was specified on the operation, the CuratorListener was silently ignored (the method returned early at if (operation.getCallback() == null) { return; }).

According to the documented behavior, CuratorListener is a catch-all fallback for BackgroundCallback when no callback is specified at the operation level. This fix ensures that the CuratorListener is properly notified via processEvent() in this case.

Changes

In CuratorFrameworkImpl.abortOperation():

  • Moved the callback-null check after the event creation
  • When callback == null, call processEvent(event) to notify all registered CuratorListener instances
  • When callback != null, continue to call sendToBackgroundCallback(operation, event) as before

Fixes #1191

…back specified

When abortOperation is called for a retriable error and no BackgroundCallback
was specified on the operation, CuratorListener was silently ignored.
Now it properly falls back to notifying all registered CuratorListeners
via processEvent(), matching the documented behavior that CuratorListener
is a catch-all fallback for BackgroundCallback.

Fixes apache#1191
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.

[CURATOR-676] CuratorListener is not called for retriable errors

1 participant