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][client] Fix ConsumerBuilderImpl#subscribe silent stuck when using pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 #21985

Conversation

Shawyeok
Copy link
Contributor

@Shawyeok Shawyeok commented Jan 29, 2024

Fixes #21971

Motivation

In summary, jackson-annotations:2.12.0 or later is now required for pulsar-client 3.0.x, and this also applies to versions 3.1.x and 3.2.x.

Otherwise, ConsumerBuilderImpl#subscribe may become stuck without displaying any error message.

Modifications

Modify the whenComplete to a combination of thenAccept and exceptionally. The modification is harmless.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: Shawyeok#11

Copy link

@Shawyeok Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Jan 29, 2024
@Shawyeok Shawyeok changed the title Fix ConsumerBuilderImpl#subscribe silent stuck when using pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 [fix][client] Fix ConsumerBuilderImpl#subscribe silent stuck when using pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 Jan 29, 2024
@Technoboy- Technoboy- added this to the 3.3.0 milestone Jan 29, 2024
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari
Copy link
Member

lhotari commented Jan 30, 2024

Modify the whenComplete to a combination of thenAccept and exceptionally. The modification is harmless.

I finally understood what the difference is. In this case, it matters since there's a separate CompletableFuture subscribeResult which is the actual result. If the handler of whenComplete itself throws an exception, the subscribeResult didn't get completed with the exception. The fix will address that.
Good catch @Shawyeok! Thanks for fixing.

@congbobo184 congbobo184 merged commit 63f0168 into apache:master Jan 30, 2024
51 of 55 checks passed
Technoboy- pushed a commit that referenced this pull request Jan 31, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.
Technoboy- pushed a commit that referenced this pull request Feb 5, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.
Technoboy- pushed a commit that referenced this pull request Feb 5, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.
Technoboy- pushed a commit that referenced this pull request Feb 20, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.
nodece pushed a commit to nodece/pulsar that referenced this pull request Feb 23, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (apache#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 1, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (apache#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.

(cherry picked from commit 327b973)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 6, 2024
…ng pulsar-client:3.0.x with jackson-annotations prior to 2.12.0 (apache#21985)

### Motivation
In summary, `jackson-annotations:2.12.0` or later is now required for `pulsar-client 3.0.x`, and this also applies to versions `3.1.x` and `3.2.x`.

Otherwise, `ConsumerBuilderImpl#subscribe` may become stuck without displaying any error message.

### Modifications

Modify the `whenComplete` to a combination of `thenAccept` and `exceptionally`. The modification is harmless.

(cherry picked from commit 327b973)
@Shawyeok Shawyeok deleted the fix-subscribe-never-completes-with-legacy-version-of-jackson branch March 20, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment