From 97a01853b8e2bc2329e82dea8da920048c095d14 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 1 Apr 2025 22:56:34 +0300 Subject: Unwind the stack when handling transaction errors As this avoids trying to suspend while the stack is in a unpredictable state. --- guix-data-service/database.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guix-data-service/database.scm b/guix-data-service/database.scm index 26e40a0..86747e0 100644 --- a/guix-data-service/database.scm +++ b/guix-data-service/database.scm @@ -216,13 +216,15 @@ (lambda () (exec-query conn "ROLLBACK;")) #:unwind? #t) + ;; TODO Include the stack in the exception via knots (raise-exception exn)) (lambda () (let ((result (f conn))) (exec-query conn (if always-rollback? "ROLLBACK;" "COMMIT;")) - result)))) + result)) + #:unwind? #t)) (define (check-test-database! conn) (match (exec-query conn "SELECT current_database()") -- cgit v1.2.3