Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix no response to client when handleSubscribe because PendingAckHandleImpl init fail #13655

Merged
merged 5 commits into from
Jan 14, 2022

Conversation

wenbingshen
Copy link
Member

@wenbingshen wenbingshen commented Jan 6, 2022

Fixes #13654

Modifications

When the initialization of PendingAckHandleImpl fails, pendingAckHandleCompletableFuture will not be exception or complete, then org.apache.pulsar.broker.service.persistent.PersistentSubscription#addConsumer will not return any response to the client.

public CompletableFuture<Void> addConsumer(Consumer consumer) {
        return pendingAckHandle.pendingAckHandleFuture().thenCompose(future -> ...)
}

Documentation

Need to update docs?

  • no-need-doc

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

@wenbingshen:Thanks for your contribution. For this PR, do we need to update docs?
(The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

@wenbingshen
Copy link
Member Author

@congbobo184 @codelipenghui PTAL, Thanks.

@Technoboy-
Copy link
Contributor

@congbobo184 @codelipenghui PTAL, Thanks.

Hi, please fix the checkstyle.

@wenbingshen
Copy link
Member Author

wenbingshen commented Jan 6, 2022

@congbobo184 @codelipenghui PTAL, Thanks.

Hi, please fix the checkstyle.

sure. I have fixed the checkstyle.

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

@wenbingshen:Thanks for providing doc info!

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 6, 2022
@wenbingshen
Copy link
Member Author

/pulsarbot run-failure-checks

@@ -141,6 +142,9 @@ private void initPendingAckStore() {
}).exceptionally(e -> {
acceptQueue.clear();
changeToErrorState();
pendingAckHandleCompletableFuture.completeExceptionally(
new TransactionPendingAckException.TransactionPendingAckStoreProviderException(
e.getMessage()));
Copy link
Contributor

Choose a reason for hiding this comment

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

e.getMessage() -> e.getCause() is much better.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your review. Good idea. I have addressed your comment. PTAL.

@wenbingshen wenbingshen force-pushed the fix_Subscribe_response branch from 52ff293 to de15c63 Compare January 7, 2022 03:14
@wenbingshen
Copy link
Member Author

/pulsarbot run-failure-checks

2 similar comments
@wenbingshen
Copy link
Member Author

/pulsarbot run-failure-checks

@wenbingshen
Copy link
Member Author

/pulsarbot run-failure-checks

@congbobo184 congbobo184 merged commit 528c972 into apache:master Jan 14, 2022
codelipenghui pushed a commit that referenced this pull request Jan 18, 2022
…leImpl init fail (#13655)

Fixes #13654

### Modifications

When the initialization of `PendingAckHandleImpl` fails, `pendingAckHandleCompletableFuture` will not be exception or complete, then `org.apache.pulsar.broker.service.persistent.PersistentSubscription#addConsumer` will not return any response to the client.

```
public CompletableFuture<Void> addConsumer(Consumer consumer) {
        return pendingAckHandle.pendingAckHandleFuture().thenCompose(future -> ...)
}
```

(cherry picked from commit 528c972)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jan 18, 2022
@wenbingshen wenbingshen deleted the fix_Subscribe_response branch February 15, 2023 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transaction cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.9.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No response to client when handleSubscribe because PendingAckHandleImpl init fail
5 participants