-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
regex subscription not working for new topics in Python #7168
Comments
Thanks @baynes for reporting this issue. Since it is able to reproduce, mark it as help-wanted firstly. Any help on fix this issue is very appreciated. |
TL;DR It's because there's a deadlock in C++ client. I'll push a PR soon. Just because C++ stand library doesn't have something like The deadlock problem is similar to my PR before, see the change of |
…auto discovery (#7206) Fixes #7168 ### Motivation When a pattern consumer is blocked by `receive()`, the `mutex_` will be held until new messages arrived. If the auto discovery timer task found new topics and tried to subscribe them, `mutex_` must be acquired first, then the deadlock happened. ### Modifications - Release the `mutex_` after the consumer's state was verified. - Change unit tests to verify that new topics could be subscribed when the consumer's blocked by `receive(Message&)` or `receive(Message&, int)` methods. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is already covered by existing tests, such as *BasicEndToEndTest.testPatternMultiTopicsConsumerAutoDiscovery*.
…auto discovery (apache#7206) Fixes apache#7168 ### Motivation When a pattern consumer is blocked by `receive()`, the `mutex_` will be held until new messages arrived. If the auto discovery timer task found new topics and tried to subscribe them, `mutex_` must be acquired first, then the deadlock happened. ### Modifications - Release the `mutex_` after the consumer's state was verified. - Change unit tests to verify that new topics could be subscribed when the consumer's blocked by `receive(Message&)` or `receive(Message&, int)` methods. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is already covered by existing tests, such as *BasicEndToEndTest.testPatternMultiTopicsConsumerAutoDiscovery*.
…auto discovery (apache#7206) Fixes apache#7168 ### Motivation When a pattern consumer is blocked by `receive()`, the `mutex_` will be held until new messages arrived. If the auto discovery timer task found new topics and tried to subscribe them, `mutex_` must be acquired first, then the deadlock happened. ### Modifications - Release the `mutex_` after the consumer's state was verified. - Change unit tests to verify that new topics could be subscribed when the consumer's blocked by `receive(Message&)` or `receive(Message&, int)` methods. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is already covered by existing tests, such as *BasicEndToEndTest.testPatternMultiTopicsConsumerAutoDiscovery*.
Describe the bug
If a new topic is added that matches a regex subscription then if the client is written in Java it detects it and adds a cursor but if it is written in Python it does not.
To Reproduce
Steps to reproduce the behavior:
Run the following as a Phython3 client:
In another window run this command to get a Java client for comparison:
In another window send a message to a new topic:
Wait a minute for the clients to detect the new topic.
Send another message to the same topic.
The Java client receives the message but the Python one does not.
Kill and restart the clients. Send a message to the same topic.
Both clients receive the message.
Expected behavior
Both clients should receive the second message.
Screenshots
NA
Desktop (please complete the following information):
Centos 7
Pulsar 2.5.1
Python pulsar-client 2.5.2
Additional context
initial_position=pulsar.InitialPosition.Earliest
does not helpThe text was updated successfully, but these errors were encountered: