-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Inconsistent subscription behavior with deleted topic #2413
Comments
Right, the subscription (at path
As it should: your example doesn't delete the orphaned subscription created during the first time through. Creating it anew from the topic doesn't change its path, which is still
This one is the slightly odd case: it would almost appear that the path used in |
I understand all the of the mechanics of why this back-end causes the python library to return these results, but users of the python library should not have to understand these back-end implementation details IMO. If the plan is to keep this mapping, perhaps additional effort (i.e. special-case code) should be applied to making the python object behaviors consistent with reasonable user expectations? At least with respect to very basic patterns like "I'll ask for the list of all subscriptions to this topic, and if the sub I want to create isn't in the list, I'll create it.", which doesn't work as intended in this case (the creation attempt fails)? |
Hello! :-) In this case, I have been in the process of making a radical update to the PubSub library (#3637) to add significant performance improvements and a new surface, which we hope to launch soon. As such, I am clearing out issues on the old library. It is my sincere goal to do a better job of being on top of issues in the future. As the preceding paragraph implies, I am closing this issue. If the revamped library does not solve your issue, however, please feel free to reopen. Thanks! |
What were you trying to do?
Note: Before beginning, the topic 'test_topic' and the subscription 'test_sub' don't exist in the project.
via google.cloud python pubsub module:
What did you expect to happen?
On the second run:
pubsub.Client().topic('test_topic').subscription('test_sub').exists()
in step How can we cover unit testing for datastore? #2 should return Falsepubsub.Client().topic('test_topic').subscription('test_sub').pull()
in step Should datastore Key's be immutable? #3 should fail with an Exception (because I've asked for the subscription 'test_sub' in the topic 'test_topic', not the 'test_sub' subscription in the 'deleted-topic' topic)What actually happened?
After having created the topic and subscription once, then having deleted/recreated the topic, the subscription shows up in 'subscriptions to topics not in this project' under pantheon (i.e. has a topic name of 'deleted-topic' as per https://cloud.google.com/pubsub/publisher#delete) as expected. But the behavior is inconsistent when accessing it programmatically via the google.cloud python module:
pubsub.Client().topics.list_topics()
returns a list without the 'test_sub' subscription in itpubsub.Client().topic('test_topic').subscription('test_sub').exists()
returns... Truepubsub.Client().topic('test_topic').subscription('test_sub').pull()
The text was updated successfully, but these errors were encountered: