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

[PubSub] subscription.on_error is called indefinitely without backoff #21521

Open
shouichi opened this issue May 2, 2023 · 1 comment
Open
Labels
api: pubsub Issues related to the Pub/Sub API. priority: p3 Desirable enhancement or 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

@shouichi
Copy link
Contributor

shouichi commented May 2, 2023

Environment details

  • OS: linux
  • Ruby version: 3.2.2
  • Gem name and version: google-cloud-pubsub

Steps to reproduce

  1. create a project, topic, and subscription
  2. start a subscriber
  3. delete the project

Code example

subscription.listen { ... }
subscription.on_error { |e| p err }

When the subscription is not found, on_error is called without backoff (almost every ms). It might be a good idea to add not found error to this clause.

rescue GRPC::Cancelled, GRPC::DeadlineExceeded, GRPC::Internal,
GRPC::ResourceExhausted, GRPC::Unauthenticated,
GRPC::Unavailable

Full backtrace

5:Requested project not found or user does not have access to it (project=project-id-here). Make sure to specify the unique project identifier and not the Google Cloud Console display name.. debug_error_string:{UNKNOWN:Error received from peer ipv4:173.194.192.95:443 {created_time:"2023-05-02T07:10:56.589985506+00:00", grpc_status:5, grpc_message:"Requested project not found or user does not have access to it (project=project-id-here). Make sure to specify the unique project identifier and not the Google Cloud Console display name."}}

/usr/local/bundle/gems/grpc-1.53.0-x86_64-linux/src/ruby/lib/grpc/generic/active_call.rb:29:in `check_status'
  /usr/local/bundle/gems/grpc-1.53.0-x86_64-linux/src/ruby/lib/grpc/generic/bidi_call.rb:211:in `block in read_loop'
  /usr/local/bundle/gems/grpc-1.53.0-x86_64-linux/src/ruby/lib/grpc/generic/bidi_call.rb:197:in `loop'
  /usr/local/bundle/gems/grpc-1.53.0-x86_64-linux/src/ruby/lib/grpc/generic/bidi_call.rb:197:in `read_loop'
  /usr/local/bundle/bin/whatever:in `each'
@NivedhaSenthil
Copy link
Member

Thanks for bringing this to our notice, the behaviour here has to be updated to shutdown the subscriber on non recoverable errors.

@NivedhaSenthil NivedhaSenthil added api: pubsub Issues related to the Pub/Sub API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p3 Desirable enhancement or fix. May not be included in next release. labels May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. priority: p3 Desirable enhancement or 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

No branches or pull requests

2 participants