Skip to content

Fix acknowledgement timeout handling in DefaultAcknowledgementSet#6209

Open
san81 wants to merge 2 commits into
opensearch-project:mainfrom
san81:ack-timeout-case-handling
Open

Fix acknowledgement timeout handling in DefaultAcknowledgementSet#6209
san81 wants to merge 2 commits into
opensearch-project:mainfrom
san81:ack-timeout-case-handling

Conversation

@san81

@san81 san81 commented Oct 30, 2025

Copy link
Copy Markdown
Collaborator

When acknowledgements time out in DefaultAcknowledgementSet, the callback is never invoked. The current implementation cancels the callback future on timeout but doesn't execute it, making caller unaware of expire event and giving the caller an option to take their required action.

The fix in this PR is to call the callback handler with false when acknowledgement set expires, which is kind of same as negative acknowledgment.

  1. Added callbackInvoked flag to prevent double invocation
  2. Modified isDone() method to invoke callback with false on timeout
  3. Updated complete() and release() methods to set the flag when invoking callback

The fix ensures that when an acknowledgement set times out, the callback is explicitly invoked with false

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…meout.

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
Comment on lines -147 to -150
public Instant getExpiryTime() {
return expiryTime;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Unused method

Signed-off-by: Santhosh Gandhe <1909520+san81@users.noreply.github.com>
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.

1 participant