Skip to content

Tailing streams on closing a bidi stream. #850

@pujawadare

Description

@pujawadare

The close() method of the bidi module, resets the fields only when the self.call field is not None.

    def close(self):
        """Closes the stream."""
        if self.call is None:
            return

        self._request_queue.put(None)
        self.call.cancel()
        ....

This is problematic, when an exception is raised in the open() and we do not set the self.call. This scenario leads to the stream not getting closed properly(half closed state from server). And we are able to observe these tailing streams(which are causing further issues for us) incase of reopens and other retries. Also observed that these tailing streams get closed automatically after some time(15-20 mins).

Environment details

Using gcloud installation.

  • OS type and version: Ubuntu 22.04.5 LTS, Mac OS Sequoia 15.7.1. Not tested on other OS.
  • Python version: Bundled python which comes with gcloud.
  • google-api-core version: Using gcloud installation version with 545.0.0

Sharing further information internally(@pujawadare googler), as some information may be sensitive.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions