From 141fcaaa8afa9baceaf98747cc1f8085d4535f3d Mon Sep 17 00:00:00 2001 From: David Nadligner Date: Wed, 11 Jul 2018 20:09:18 +0100 Subject: [PATCH] worker_db: Only warn on repeated archive read if dataset changed In larger experiments, it is quite natural for the same dataset to be read from multiple unrelated components. The only situation where multiple reads from an archived dataset are problematic is when the valeu actually changes between reads. Hence, this commit restricts the warning to the latter situation. --- artiq/master/worker_db.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/master/worker_db.py b/artiq/master/worker_db.py index 1a4ef61e6..22190a087 100644 --- a/artiq/master/worker_db.py +++ b/artiq/master/worker_db.py @@ -227,9 +227,9 @@ class DatasetManager: else: data = self.ddb.get(key) if archive: - if key in self.archive: - logger.warning("Dataset '%s' is already in archive, " - "overwriting", key, stack_info=True) + if self.archive.get(key, data) != data: + logger.warning("Older value of dataset '%s' is already in " + "archive, overwriting", key, stack_info=True) self.archive[key] = data return data