From 4ff162e0c52ce6f8d602e51c3c65434aedbda349 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Tue, 26 Sep 2023 19:25:05 -0700 Subject: [PATCH] fix occasional deadlock --- datastore/threads/threadproxyds.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datastore/threads/threadproxyds.nim b/datastore/threads/threadproxyds.nim index 4b46795..dcff5e0 100644 --- a/datastore/threads/threadproxyds.nim +++ b/datastore/threads/threadproxyds.nim @@ -265,7 +265,8 @@ proc queryTask[DB]( # otherwise manually an set empty ok result ctx[].res.ok (KeyId.none, DataBuffer(), ) discard ctx[].signal.fireSync() - discard nextSignal.waitSync().get() + if not nextSignal.waitSync(1.seconds).get(): + raise newException(DeadThreadDefect, "query task timeout; possible deadlock!") var handle = handleRes.get() for item in handle.iter():