From 97760af4bc1dad4ed9f44c33c77ac29446dd4383 Mon Sep 17 00:00:00 2001 From: Paul Armstrong Date: Mon, 11 Nov 2024 13:14:18 +1000 Subject: [PATCH 1/3] Report the error if write attempts fail to the DB Make it easier to debug write attempt failures by logging the error from SQLite. --- cylc/flow/rundb.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cylc/flow/rundb.py b/cylc/flow/rundb.py index c715079491..fcd5d2b12a 100644 --- a/cylc/flow/rundb.py +++ b/cylc/flow/rundb.py @@ -481,7 +481,7 @@ def execute_queued_items(self): # something went wrong # (includes DB file not found, transaction processing issue, db locked) - except sqlite3.Error: + except sqlite3.Error as e: if not self.is_public: # incase this isn't a filesystem issue, log the statements # which make up the transaction to assist debug @@ -493,8 +493,8 @@ def execute_queued_items(self): raise self.n_tries += 1 LOG.warning( - "%(file)s: write attempt (%(attempt)d) did not complete\n" % { - "file": self.db_file_name, "attempt": self.n_tries}) + "%(file)s: write attempt (%(attempt)d) did not complete: %(error)s\n" % { + "file": self.db_file_name, "attempt": self.n_tries, "error": str(e)}) if self.conn is not None: with suppress(sqlite3.Error): self.conn.rollback() From 94adacab165406fdf3d402c12cdcdcbcddd175a4 Mon Sep 17 00:00:00 2001 From: Paul Armstrong Date: Mon, 11 Nov 2024 13:17:50 +1000 Subject: [PATCH 2/3] Add Paul Armstrong to CONTRIBUTING.md --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4e77fd82a..d215aaf3e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ We use [semver](https://semver.org/) to separate riskier changes (e.g. new featu (e.g. 8.1, 8.2, 8.3) **Bugfixes** and minor usability enhancements are made on bugfix branches and -released as the next maintainance version (e.g. 8.0.1, 8.0.2, 8.0.3). E.G. if the issue is on the `8.0.x` milestone, branch off of `8.0.x` to +released as the next maintenance version (e.g. 8.0.1, 8.0.2, 8.0.3). E.G. if the issue is on the `8.0.x` milestone, branch off of `8.0.x` to develop your bugfix, then raise the pull request against the `8.0.x` branch. We will later merge the `8.0.x` branch into `master`. Feel free to ask questions on the issue or @@ -96,6 +96,7 @@ requests_). - Diquan Jabbour - Shixian Sheng - Utheri Wagura + - Paul Armstrong (All contributors are identifiable with email addresses in the git version From 50b79b2e3be5484d70c82e16b8c2386521b38358 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Mon, 11 Nov 2024 13:05:46 +0000 Subject: [PATCH 3/3] Update cylc/flow/rundb.py --- cylc/flow/rundb.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cylc/flow/rundb.py b/cylc/flow/rundb.py index fcd5d2b12a..216895fd99 100644 --- a/cylc/flow/rundb.py +++ b/cylc/flow/rundb.py @@ -493,8 +493,13 @@ def execute_queued_items(self): raise self.n_tries += 1 LOG.warning( - "%(file)s: write attempt (%(attempt)d) did not complete: %(error)s\n" % { - "file": self.db_file_name, "attempt": self.n_tries, "error": str(e)}) + "%(file)s: write attempt (%(attempt)d)" + " did not complete: %(error)s\n" % { + "file": self.db_file_name, + "attempt": self.n_tries, + "error": str(e) + } + ) if self.conn is not None: with suppress(sqlite3.Error): self.conn.rollback()