From 5f49e582c86143afe94f2e93ba49bb40d8e2d27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bourdeauducq?= Date: Tue, 2 Apr 2024 16:10:00 +0800 Subject: [PATCH] master: fix race condition in interactive args supply Closes #2375 --- artiq/master/databases.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/master/databases.py b/artiq/master/databases.py index 6edcc966d..d889933d7 100644 --- a/artiq/master/databases.py +++ b/artiq/master/databases.py @@ -133,7 +133,7 @@ class InteractiveArgDB: def supply(self, rid, values): # quick sanity checks - if rid not in self.futures: + if rid not in self.futures or self.futures[rid].done(): raise ValueError("no experiment with this RID is " "waiting for interactive arguments") if {i[0] for i in self.pending.raw_view[rid]["arglist_desc"]} != set(values.keys()): @@ -141,7 +141,7 @@ class InteractiveArgDB: self.futures[rid].set_result(values) def cancel(self, rid): - if rid not in self.futures: + if rid not in self.futures or self.futures[rid].done(): raise ValueError("no experiment with this RID is " "waiting for interactive arguments") self.futures[rid].set_result(None)