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

Make acknowledge APIs synchronous and improve the documents #121

Merged
merged 1 commit into from
May 24, 2023

Conversation

BewareMyPower
Copy link
Contributor

Fixes #114

Motivation

Currently the acknowledge and acknowledge_cumulative methods are all asynchronous. Even if any error happened, no exception would be raised. For example, when acknowledging cumulatively on a consumer whose consumer type is Shared or KeyShared, no error happens.

Modifications

  • Change these methods to synchronous and raise exceptions if the acknowledgment failed.
  • Add PulsarTest.test_acknowledge_failed to test these failed cases.
  • Improve the documents to describe which exceptions could be raised in which cases.

Fixes apache#114

### Motivation

Currently the `acknowledge` and `acknowledge_cumulative` methods are all
asynchronous. Even if any error happened, no exception would be raised.
For example, when acknowledging cumulatively on a consumer whose
consumer type is Shared or KeyShared, no error happens.

### Modifications

- Change these methods to synchronous and raise exceptions if the
  acknowledgment failed.
- Add `PulsarTest.test_acknowledge_failed` to test these failed cases.
- Improve the documents to describe which exceptions could be raised in
  which cases.
@BewareMyPower
Copy link
Contributor Author

image

@merlimat merlimat merged commit 0028893 into apache:main May 24, 2023
10 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/ack-error branch May 25, 2023 02:03
BewareMyPower added a commit to BewareMyPower/pulsar-client-python that referenced this pull request Dec 25, 2023
Fixes apache#178

### Motivation

apache#121 introduces a
regression that when `negative_acknowledge` accepts a message ID, the
underlying `acknowledgeAsync` method will be called.

### Modifications

Fix the `Consumer_negative_acknowledge_message_id` method and add the
test for negative acknowledging message IDs in `test_redelivery_count`.
BewareMyPower added a commit that referenced this pull request Dec 26, 2023
Fixes #178

### Motivation

#121 introduces a
regression that when `negative_acknowledge` accepts a message ID, the
underlying `acknowledgeAsync` method will be called.

### Modifications

Fix the `Consumer_negative_acknowledge_message_id` method and add the
test for negative acknowledging message IDs in `test_redelivery_count`.
RobertIndie pushed a commit that referenced this pull request Dec 26, 2023
Fixes #178

### Motivation

#121 introduces a
regression that when `negative_acknowledge` accepts a message ID, the
underlying `acknowledgeAsync` method will be called.

### Modifications

Fix the `Consumer_negative_acknowledge_message_id` method and add the
test for negative acknowledging message IDs in `test_redelivery_count`.

(cherry picked from commit b9c7219)
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.

Segmentation fault for acknowledge_cumulative
2 participants