Skip to content

Commit aaedf2f

Browse files
authored
Catch asyncio.CancelledError during attempt tear-down (#88)
1 parent 41312c7 commit aaedf2f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/restate/server_context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,12 @@ def safe_remove(_):
258258
except KeyError:
259259
pass
260260
try:
261-
# this will raise if the task was cancelled
262261
_ = task.result()
263262
# pylint: disable=W0718
264263
except Exception:
265264
pass
265+
except asyncio.CancelledError:
266+
pass
266267

267268
task.add_done_callback(safe_remove)
268269

0 commit comments

Comments
 (0)