diff --git a/grpclib/protocol.py b/grpclib/protocol.py index 314449c..66f66c1 100644 --- a/grpclib/protocol.py +++ b/grpclib/protocol.py @@ -476,6 +476,8 @@ def __terminated__(self, reason: str) -> None: @property def closable(self) -> bool: + if self._transport.is_closing(): + return False if self._h2_connection.state_machine.state is ConnectionState.CLOSED: return False stream = self._h2_connection.streams.get(self.id)