Skip to content
New issue

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

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

Already on GitHub? # to your account

[fix] [client] Unclear error message when creating a consumer with two same topics #22255

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

poorbarcode
Copy link
Contributor

Motivation

When I create a MultiTopicsConsumer using the two same topics, I get a warning log Topic is already being subscribed for in another thread, which is not clear.

  • persistent://public/default/tp
  • public/default/tp
2024-03-13T00:27:42,785 - INFO  - [pulsar-client-io-35-2:ConsumerImpl@938] - [persistent://public/default/tp-8446b215-9f1d-470f-af07-eb9be8b15415][s1] Subscribed to topic on localhost/127.0.0.1:49225 -- consumer: 0
2024-03-13T00:27:42,785 - WARN  - [pulsar-client-io-35-2:MultiTopicsConsumerImpl@186] - [MultiTopicsConsumer-2d576] Failed to subscribe topics: org.apache.pulsar.client.api.PulsarClientException: [MultiTopicsConsumer-2d576] Failed to subscribe for topic [persistent://public/default/tp-8446b215-9f1d-470f-af07-eb9be8b15415] in topics consumer. Topic is already being subscribed for in other thread., closing consumer
2024-03-13T00:27:42,787 - INFO  - [pulsar-client-io-35-2:MultiTopicsConsumerImpl@1135] - [MultiTopicsConsumer-2d576] [s1] Success subscribe new topic persistent://public/default/tp-8446b215-9f1d-470f-af07-eb9be8b15415 in topics consumer, partitions: 0, allTopicPartitionsNumber: 2
2024-03-13T00:27:42,788 - INFO  - [pulsar-io-8-4:ServerCnx@2108] - [/127.0.0.1:49232] Closing consumer: consumerId=0
2024-03-13T00:27:42,788 - INFO  - [pulsar-io-8-4:AbstractDispatcherSingleActiveConsumer@227] - Removing consumer Consumer{subscription=PersistentSubscription{topic=persistent://public/default/tp-8446b215-9f1d-470f-af07-eb9be8b15415, name=s1}, consumerId=0, consumerName=c1651, address=/127.0.0.1:49232}
2024-03-13T00:27:42,789 - INFO  - [pulsar-io-8-4:ServerCnx@2144] - [/127.0.0.1:49232] Closed consumer, consumerId=0

Modifications

Correct the param check: MultiTopicsConsumer.topics

Documentation

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

Matching PR in forked repository

PR in forked repository: x

@poorbarcode poorbarcode self-assigned this Mar 12, 2024
@poorbarcode poorbarcode added this to the 3.3.0 milestone Mar 12, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Mar 12, 2024
@Technoboy- Technoboy- changed the title [fix] [client] Unclear error message when creating a consumer with tw… [fix] [client] Unclear error message when creating a consumer with two same topics Mar 14, 2024
@Technoboy- Technoboy- closed this Mar 14, 2024
@Technoboy- Technoboy- reopened this Mar 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.64%. Comparing base (bbc6224) to head (f5afd2b).
Report is 65 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #22255      +/-   ##
============================================
+ Coverage     73.57%   73.64%   +0.07%     
+ Complexity    32624    32247     -377     
============================================
  Files          1877     1887      +10     
  Lines        139502   139453      -49     
  Branches      15299    15294       -5     
============================================
+ Hits         102638   102706      +68     
+ Misses        28908    28810      -98     
+ Partials       7956     7937      -19     
Flag Coverage Δ
inttests 26.95% <44.44%> (+2.37%) ⬆️
systests 24.43% <44.44%> (+0.11%) ⬆️
unittests 72.90% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...he/pulsar/client/impl/MultiTopicsConsumerImpl.java 78.79% <100.00%> (+1.06%) ⬆️

... and 160 files with indirect coverage changes

@poorbarcode poorbarcode requested a review from nodece March 18, 2024 12:03
@poorbarcode poorbarcode merged commit c616b35 into apache:master Mar 19, 2024
50 checks passed
Technoboy- pushed a commit that referenced this pull request Mar 20, 2024
poorbarcode added a commit that referenced this pull request Mar 26, 2024
poorbarcode added a commit that referenced this pull request Mar 26, 2024
poorbarcode added a commit that referenced this pull request Mar 26, 2024
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 15, 2024
…o same topics (apache#22255)

(cherry picked from commit c616b35)
(cherry picked from commit 5ab0e93)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…o same topics (apache#22255)

(cherry picked from commit c616b35)
(cherry picked from commit 5ab0e93)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 17, 2024
…o same topics (apache#22255)

(cherry picked from commit c616b35)
(cherry picked from commit 5ab0e93)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 19, 2024
…o same topics (apache#22255)

(cherry picked from commit c616b35)
(cherry picked from commit 5ab0e93)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Apr 23, 2024
…o same topics (apache#22255)

(cherry picked from commit c616b35)
(cherry picked from commit 5ab0e93)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request May 13, 2024
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants