Skip to content

Commit

Permalink
fix: fix regression in bidi causing `Thread-ConsumeBidirectionalStr…
Browse files Browse the repository at this point in the history
…eam caught unexpected exception and will exit` (#562)

* chore: partial revert of PR #357

This reverts commit e120a0c.

* add comment
  • Loading branch information
parthea authored Dec 1, 2023
1 parent 3069ef4 commit 40c8ae0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions google/api_core/bidi.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ def __init__(self, queue, period=1, initial_request=None):
def _is_active(self):
# Note: there is a possibility that this starts *before* the call
# property is set. So we have to check if self.call is set before
# seeing if it's active.
return self.call is not None and self.call.is_active()
# seeing if it's active. We need to return True if self.call is None.
# See https://github.com/googleapis/python-api-core/issues/560.
if self.call is not None and not self.call.is_active():
return False
else:
return True

def __iter__(self):
if self._initial_request is not None:
Expand Down

0 comments on commit 40c8ae0

Please sign in to comment.