googleapis / python-pubsub

Apache License 2.0
392 stars 206 forks source link

subscriber.subscribe() does not surface BaseException() encountered in the user provided callback function to the calling code #1107

Closed mukund-ananthu closed 8 months ago

mukund-ananthu commented 8 months ago
  1. Currently, the behavior of the library is to catch Exception() when encountered in the user provided callback, surface it to the calling code and shut down the client.

https://github.com/googleapis/python-pubsub/blob/0562d23f1116219037111432bc4d49f27b879efb/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py#L127

  1. However, for BaseException() encountered in the user provided callback, the BaseException() is not surfaced to the calling code and the client is not shut down.

  2. Make the behavior of the client when BaseException() is encountered consistent with the behavior of the client when Exception() is encountered.