Skip to content

Commit 41312c7

Browse files
authored
Fix task error is ignored (#87)
1 parent 55dd26b commit 41312c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/restate/server_context.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ def safe_remove(_):
257257
self.tasks.remove(task)
258258
except KeyError:
259259
pass
260+
try:
261+
# this will raise if the task was cancelled
262+
_ = task.result()
263+
# pylint: disable=W0718
264+
except Exception:
265+
pass
260266

261267
task.add_done_callback(safe_remove)
262268

0 commit comments

Comments
 (0)