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

streaming_pull_future.cancel() hangs #95

Closed
anguillanneuf opened this issue Mar 9, 2021 · 2 comments
Closed

streaming_pull_future.cancel() hangs #95

anguillanneuf opened this issue Mar 9, 2021 · 2 comments
Assignees
Labels
api: pubsublite Issues related to the googleapis/python-pubsublite API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@anguillanneuf
Copy link
Collaborator

anguillanneuf commented Mar 9, 2021

How to reproduce:

cd samples/snippets/
pip install -r requirements.txt
python subscriber_example.py $PROJECT_ID $REGION $ZONE_ID $SUBSCRIPTION_ID 60

The timeout exception is caught first, but calling cancel() on the future returned by the subscriber client next hangs:

Traceback (most recent call last):
  File "subscriber_example.py", line 74, in receive_messages
    streaming_pull_future.result(timeout=timeout)
  File "/Users/tianzi/.virtualenvs/py388/lib/python3.8/site-packages/google/cloud/pubsub_v1/futures.py", line 102, in result
    err = self.exception(timeout=timeout)
  File "/Users/tianzi/.virtualenvs/py388/lib/python3.8/site-packages/google/cloud/pubsub_v1/futures.py", line 122, in exception
    raise exceptions.TimeoutError("Timed out waiting for result.")
concurrent.futures._base.TimeoutError: Timed out waiting for result.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "subscriber_example.py", line 99, in <module>
    receive_messages(
  File "subscriber_example.py", line 76, in receive_messages
    streaming_pull_future.cancel()
  File "/Users/tianzi/.virtualenvs/py388/lib/python3.8/site-packages/google/cloud/pubsub_v1/subscriber/futures.py", line 62, in cancel
    return self._manager.close(await_msg_callbacks=await_msg_callbacks)
TypeError: close() got an unexpected keyword argument 'await_msg_callbacks'
@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/python-pubsublite API. label Mar 9, 2021
@anguillanneuf anguillanneuf added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Mar 9, 2021
@anguillanneuf anguillanneuf changed the title streaming_pull_future.cancel() errors out streaming_pull_future.cancel() errors out and hangs Mar 9, 2021
@anguillanneuf anguillanneuf changed the title streaming_pull_future.cancel() errors out and hangs streaming_pull_future.cancel() hangs Mar 9, 2021
@plamut
Copy link

plamut commented Mar 10, 2021

Please see the fix in PubSub "main" client, I believe the error is caused by the StreamingPullFuture passing in the new argument, that is not supported by the PubSub Lite client's close() method? Is there anything else that the Lite client depends on that might affect it?

I presume it's also not feasible to add support for await_msg_callbacks parameter to the Lite client itself?

@dpcollins-google
Copy link
Collaborator

This issue has been resolved by rolling back the update to the pubsub library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/python-pubsublite API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

No branches or pull requests

3 participants