diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 312293d..b1fcb13 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,10 +15,10 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 @@ -33,7 +33,7 @@ jobs: TOXENV: static test: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python-version: @@ -44,10 +44,10 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -74,10 +74,10 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 diff --git a/.gitignore b/.gitignore index 269f432..be75479 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ __pycache__ .tox *_pb2.py *_pb2_grpc.py -.coverage \ No newline at end of file +.coverage +.DS_Store +.idea/ +build/ +dist/ diff --git a/nameko_grpc/connection.py b/nameko_grpc/connection.py index fbd7b42..b3ea751 100644 --- a/nameko_grpc/connection.py +++ b/nameko_grpc/connection.py @@ -214,12 +214,15 @@ def stream_ended(self, event): def stream_reset(self, event): """Called when an incoming stream is reset. - Close any `ReceiveStream` that was opened for this stream. + Close any Streams that we have opened for this stream_id """ log.debug("stream reset, stream %s", event.stream_id) receive_stream = self.receive_streams.pop(event.stream_id, None) if receive_stream: receive_stream.close() + send_stream = self.send_streams.pop(event.stream_id, None) + if send_stream: + send_stream.close() def settings_changed(self, event): log.debug("settings changed") diff --git a/tox.ini b/tox.ini index ff1fd3f..c7323f3 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = static, {py3.6,py3.7,py3.8,py3.9}-test skipsdist = True [testenv] -whitelist_externals = make +allowlist_externals = make commands = static: pip install pre-commit