From f3ea45f7e4408c95cf5d7115c5528e828989b0d7 Mon Sep 17 00:00:00 2001 From: Stephen Collinson Date: Mon, 3 Apr 2023 15:57:42 +0100 Subject: [PATCH 1/3] build changes --- .gitignore | 6 +++++- tox.ini | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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/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 From b5ab085863afbecfddaf2ecd4b3f7f262274604d Mon Sep 17 00:00:00 2001 From: Stephen Collinson Date: Mon, 3 Apr 2023 16:02:03 +0100 Subject: [PATCH 2/3] Close all stream wrappers when receiving stream_reset --- nameko_grpc/connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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") From 64e7fb02d812ebbe3cfe3d0eb75246ee4d1cd28e Mon Sep 17 00:00:00 2001 From: Stephen Collinson Date: Mon, 3 Apr 2023 16:10:35 +0100 Subject: [PATCH 3/3] fix build --- .github/workflows/ci.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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