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

Skip to content

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

Closed
@ostrokach

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.

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