Skip to content

Publisher Client does not enter paused state before future.set_exception #1144

@mukund-ananthu

Description

@mukund-ananthu

For non-retriable errors returned from the backend, the client library currently sets future.set_exception() for all outstanding futures:

for future in self._futures:
future.set_exception(exc)

before it tries to change its state to paused by calling the _batch_done_callback():

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

Labels

api: pubsubIssues related to the googleapis/python-pubsub API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions