From b41177574e214eb74bdfd58a2d46cf25cd9f933e Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 9 Sep 2025 20:31:16 +0200 Subject: [PATCH] Catch exception when shutting down taskpool --- codex/codex.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codex/codex.nim b/codex/codex.nim index 81357464..adab83ba 100644 --- a/codex/codex.nim +++ b/codex/codex.nim @@ -195,7 +195,11 @@ proc stop*(s: CodexServer) {.async.} = raiseAssert "Failed to stop codex node" if not s.taskpool.isNil: - s.taskpool.shutdown() + try: + s.taskpool.shutdown() + except Exception as exc: + error "Failed to stop the taskpool", failures = res.failure.len + raiseAssert("Failure in taskpool shutdown:" & exc.msg) proc new*( T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey