Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pub/Sub: logs littered with "The bidirectional RPC exited". #8803

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

Closed
ostrokach opened this issue Jul 27, 2019 · 1 comment · Fixed by #8806
Closed

Pub/Sub: logs littered with "The bidirectional RPC exited". #8803

ostrokach opened this issue Jul 27, 2019 · 1 comment · Fixed by #8806
Assignees
Labels
api: core api: pubsub Issues related to the Pub/Sub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ostrokach
Copy link

I am creating subscriptions to PubSub topics and reading messages from those subscriptions into queues. This is done interactively in a Jupyter notebook, so subscriptions can be created and destroyed repeatedly. In about ~20% of cases, I end up getting an error message logged to the console saying ERROR:google.api_core.bidi:The bidirectional RPC exited. However, I do not see that I am doing anything wrong?

Looking at the code where the error messages are emitted, it does not seem that anything pathological is going on. Maybe the severity of this error message should be reduced from _LOGGER.error("The bidirectional RPC exited.") to _LOGGER.info(...) or _LOGGER.debug(...)?

Environment details

Debian GNU/Linux rodete
Python 2.7.15
google-cloud-core=1.0.2
google-cloud-pubsub=0.41.1

Steps to reproduce

Run the following code snippet multiple times. Some of the times we get the error message ERROR:google.api_core.bidi:The bidirectional RPC exited.

Code example

import queue


def read_to_queue(subscription_path, topic_path):
    message_queue = queue.Queue()

    def callback(message):
        message.ack()
        message_queue.put(message.data)

    sub_client = pubsub_v1.SubscriberClient()
    _ = sub_client.create_subscription(subscription_path, topic_path)
    future = sub_client.subscribe(subscription_path, callback=callback)
    try:
        yield message_queue
    finally:
        future.cancel()
        sub_client.delete_subscription(subscription_path)

Stack trace

ERROR:google.api_core.bidi:The bidirectional RPC exited.
ERROR:google.api_core.bidi:The bidirectional RPC exited.
ERROR:google.api_core.bidi:The bidirectional RPC exited.
....
ERROR:google.api_core.bidi:The bidirectional RPC exited.
@tseaver
Copy link
Contributor

tseaver commented Jul 29, 2019

@ostrokach Thanks for the report. It seems clear to me that the "error" here is not an error, but a result of a clean shutdown of the BiDi channel.

@tseaver tseaver added api: pubsub Issues related to the Pub/Sub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jul 29, 2019
@tseaver tseaver changed the title PubSub logs littered with "The bidirectional RPC exited". Pub/Sub: logs littered with "The bidirectional RPC exited". Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core api: pubsub Issues related to the Pub/Sub API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants