Skip to content

Observed non-terminating stream error 500 Received RST_STREAM with error code 2 #504

@saitej09

Description

@saitej09

Hi

I am using google pubsub service with flow control mechanism. I get this error very often after processing few messages.

INFO 2021-09-22 12:56:13,932 google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager _should_terminate 685 : Observed non-terminating stream error 503 The service was unable to fulfill your request. Please try again. [code=8a75]
INFO 2021-09-22 12:56:13,933 google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager _should_recover 663 : Observed recoverable stream error 503 The service was unable to fulfill your request. Please try again. [code=8a75]
INFO 2021-09-22 12:56:13,934 google.api_core.bidi _reopen 487 : Re-established stream
INFO 2021-09-22 12:56:13,934 google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager _should_terminate 685 : Observed non-terminating stream error 503 The service was unable to fulfill your request. Please try again. [code=8a75]
INFO 2021-09-22 12:56:13,934 google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager _should_recover 663 : Observed recoverable stream error 503 The service was unable to fulfill your request. Please try again. [code=8a75]

I am using the following code for flow control. The service restarts randomly after say half an hour to one hour. Is there a solution to handle this error so that the service is not down for that half an hour to one hour period.

subscription_path = subscriber.subscription_path(project_id, subscription_id)
flow_control = pubsub_v1.types.FlowControl(max_messages=10)
streaming_pull_future = subscriber.subscribe(
        subscription_path, callback=callback_fn, flow_control=flow_control
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: pubsubIssues related to the googleapis/python-pubsub API.type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions