GNU bug report logs - #66754
No guix locate lock error handling

Previous Next

Package: guix;

Reported by: Maciej Kalandyk <m.kalandyk <at> outlook.com>

Date: Thu, 26 Oct 2023 01:06:01 UTC

Severity: normal

Done: Simon Tournier <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66754 in the body.
You can then email your comments to 66754 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#66754; Package guix. (Thu, 26 Oct 2023 01:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maciej Kalandyk <m.kalandyk <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 26 Oct 2023 01:06:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
To: bug-guix <at> gnu.org
Subject: No guix locate lock error handling
Date: Thu, 26 Oct 2023 03:04:41 +0200
If you run guix locate when another guix locate that is generating
database is running the former is going to crash with database is locked
"raw" error
It should either wait for lock to be released or display an "formatted" error

guix describe:
  guix e0b94a4
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: e0b94a4d27e6edbc7a87eafdf6fd0e163e0646db
  nonguix 182ce51
    repository URL: https://gitlab.com/nonguix/nonguix
    branch: master
    commit: 182ce510b5355163fd286553a6fec40bd7935069




Information forwarded to bug-guix <at> gnu.org:
bug#66754; Package guix. (Sat, 28 Oct 2023 17:25:01 GMT) Full text and rfc822 format available.

Message #8 received at 66754 <at> debbugs.gnu.org (full text, mbox):

From: Maciej Kalandyk <m.kalandyk <at> outlook.com>
To: 66754 <at> debbugs.gnu.org
Subject: [PATCH] add guix locate database is locked error message
Date: Sat, 28 Oct 2023 19:11:09 +0200
Change-Id: Iebe76c75d45e70317bd18d2c176dcdeaf9d6964c
Signed-off-by: Maciej Kalandyk <m.kalandyk <at> outlook.com>
---
 guix/scripts/locate.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/guix/scripts/locate.scm b/guix/scripts/locate.scm
index 93faa1aea2..a6b6036052 100644
--- a/guix/scripts/locate.scm
+++ b/guix/scripts/locate.scm
@@ -115,13 +115,21 @@ (define schema-to-migrate '((1 . "
 ")))
 
 (define (call-with-database file proc)
-  (let ((db (sqlite-open file)))
-    (dynamic-wind
-      (lambda () #t)
-      (lambda ()
-        (ensure-latest-database-schema db)
-        (proc db))
-      (lambda () (sqlite-close db)))))
+  (catch 'sqlite-error
+    (lambda ()
+      (let ((db (sqlite-open file)))
+        (dynamic-wind
+          (lambda () #t)
+          (lambda ()
+            (ensure-latest-database-schema db)
+            (proc db))
+          (lambda () (sqlite-close db)))))
+    (lambda (key . args)
+      (match args
+        [(_ 5 _)
+         (leave (G_ "database ~a is locked by another process~%")
+                file)]
+        [_ (apply throw (cons key args))]))))
 
 (define (ensure-latest-database-schema db)
   "Ensure DB follows the latest known version of the schema."

base-commit: 6d7e181ba18d11c92409a93936025fb46b9c8171
prerequisite-patch-id: 9ba8ba9723e24b3d15f07622ff1c5ae78567f6cd
-- 
2.41.0





Reply sent to Simon Tournier <zimon.toutoune <at> gmail.com>:
You have taken responsibility. (Thu, 30 Nov 2023 18:10:02 GMT) Full text and rfc822 format available.

Notification sent to Maciej Kalandyk <m.kalandyk <at> outlook.com>:
bug acknowledged by developer. (Thu, 30 Nov 2023 18:10:02 GMT) Full text and rfc822 format available.

Message #13 received at 66754-done <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Maciej Kalandyk <m.kalandyk <at> outlook.com>, 66754-done <at> debbugs.gnu.org
Subject: Re: bug#66754: [PATCH] add guix locate database is locked error
 message
Date: Thu, 30 Nov 2023 12:55:57 +0100
Hi,

Thanks for the contribution.

On sam., 28 oct. 2023 at 19:11, Maciej Kalandyk <m.kalandyk <at> outlook.com> wrote:

> Change-Id: Iebe76c75d45e70317bd18d2c176dcdeaf9d6964c

It seems it is duplicated and merged with
ce74e02078b4d2753bf0205fae205a1b704b15d4.  So closing!

Let me know if I am missing something.

Cheers,
simon




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 29 Dec 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 269 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.