guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Skip dropping the log part sequence if there's a


From: Christopher Baines
Subject: branch master updated: Skip dropping the log part sequence if there's a lock
Date: Mon, 21 Feb 2022 08:03:49 -0500

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository data-service.

The following commit(s) were added to refs/heads/master by this push:
     new 4a9d45a  Skip dropping the log part sequence if there's a lock
4a9d45a is described below

commit 4a9d45aa16b9584d8d955cb72daf6315515e3e62
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Mon Feb 21 13:02:57 2022 +0000

    Skip dropping the log part sequence if there's a lock
    
    So that the job completes. The sequence can be deleted later.
---
 guix-data-service/jobs/load-new-guix-revision.scm | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/guix-data-service/jobs/load-new-guix-revision.scm 
b/guix-data-service/jobs/load-new-guix-revision.scm
index d8f49ca..9456562 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -300,11 +300,22 @@ WHERE job_id = $1")
       (list job-id)))))
 
 (define (drop-log-parts-sequence conn job-id)
-  (exec-query
+  (with-postgresql-transaction
    conn
-   (string-append
-    "DROP SEQUENCE IF EXISTS "
-    (log-part-sequence-name job-id))))
+   (lambda (conn)
+     (exec-query conn
+                 "SET LOCAL lock_timeout = '10s'")
+     (with-exception-handler
+         (lambda (exn)
+           (simple-format (current-error-port)
+                          "error when dropping sequence: ~A"
+                          exn))
+       (lambda ()
+         (exec-query conn
+                     (string-append
+                      "DROP SEQUENCE IF EXISTS "
+                      (log-part-sequence-name job-id))))
+       #:unwind? #t))))
 
 (define (vacuum-log-parts-table conn)
   (exec-query



reply via email to

[Prev in Thread] Current Thread [Next in Thread]