Skip to content

Commit

Permalink
Merge pull request #6470 from psa/db-exception-detail
Browse files Browse the repository at this point in the history
Db exception detail
  • Loading branch information
oliver-sanders authored Nov 11, 2024
2 parents 4fbe772 + 50b79b2 commit 4686f5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -96,6 +96,7 @@ requests_).
- Diquan Jabbour
- Shixian Sheng
- Utheri Wagura
- Paul Armstrong
- Paul Earnshaw
<!-- end-shortlog -->

Expand Down
11 changes: 8 additions & 3 deletions cylc/flow/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\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()
Expand Down

0 comments on commit 4686f5f

Please sign in to comment.