-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.
Description
For non-retriable errors returned from the backend, the client library currently sets future.set_exception() for all outstanding futures:
python-pubsub/google/cloud/pubsub_v1/publisher/_batch/thread.py
Lines 285 to 286 in 8c7e2a9
| for future in self._futures: | |
| future.set_exception(exc) |
before it tries to change its state to paused by calling the _batch_done_callback():
python-pubsub/google/cloud/pubsub_v1/publisher/_batch/thread.py
Lines 289 to 291 in 8c7e2a9
| if self._batch_done_callback is not None: | |
| # Failed to publish batch. | |
| self._batch_done_callback(batch_transport_succeeded) |
This results in race conditions where the callback associated with the future is invoked before the client enters paused state. Which causes issues if the callback attempts to do a resume_publish() before the client is in the paused state.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.