Skip to content

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

Closed

Description

@ostrokach

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.

Activity

  1. tseaver commented on Jul 29, 2019

    @tseaver
    Contributor

    @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.

  2. added
    api: pubsubIssues related to the Pub/Sub API.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jul 29, 2019
  3. changed the title [-]PubSub logs littered with "The bidirectional RPC exited".[/-] [+]Pub/Sub: logs littered with "The bidirectional RPC exited".[/+] on Jul 29, 2019
  4. added a commit that references this issue on Jul 29, 2019
    ce5a8df
  5. added a commit that references this issue on Nov 24, 2025
    cd9ad04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: coreapi: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions