unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 54447@debbugs.gnu.org, guix-sysadmin <guix-sysadmin@gnu.org>
Subject: bug#54447: cuirass: missing derivation error
Date: Tue, 10 Oct 2023 17:52:54 +0200	[thread overview]
Message-ID: <87r0m2v5ih.fsf@gnu.org> (raw)
In-Reply-To: <877d8r4etz.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 18 Mar 2022 13:36:56 +0100")

[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]

Hello!

Mathieu Othacehe <othacehe@gnu.org> skribis:

> A lot of builds, among them ~20 system tests[1], are failing with:
> "cannot build missing derivation
> ?/gnu/store/hs6kp1lqgymhyp3jndc0dsp0pn4psgv0-gui-installed-desktop-os-encrypted.drv?"
> errors.

I have a disappointingly simple hypothesis for this.  Remember that
“missing derivation” errors happen primarily for system tests.

Turns out that ‘cleanup-cuirass-roots’ in maintenance.git, used as an
mcron job, explicitly removes GC roots for things like *-os-encrypted
once they’re more than two days old, as well as GC roots for the
corresponding .drv.

I think this was increasing the likelihood that a .drv would be GC’d by
the time we run the test: under high load¹, it’s plausible that a system
test wouldn’t be built within two days after it’s been queued.

I’m proposing the change below to address this; I don’t think we need
‘--gc-keep-outputs --gc-keep-derivations’ anymore now that we keep
things in ‘guix publish’ cache first and foremost.

Thoughts?

In addition to the mcron job, Cuirass’s own ‘register-gc-roots’
procedure periodically deletes GC roots older than ‘%gc-roots-ttl’ (30
days in practice).  That’s okay, except that it would be safer to delete
GC roots for a .drv if and only if it’s been built already.

Thanks,
Ludo’.

¹ The queue was often processed slowly, with many workers remaining idle
  due to the bug fixed by
  <https://git.savannah.gnu.org/cgit/guix/guix-cuirass.git/commit/?id=40f70d28aed55c404cca6a0760860fb4942e6bee>.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 3079 bytes --]

diff --git a/hydra/modules/sysadmin/services.scm b/hydra/modules/sysadmin/services.scm
index fecfdde..e6f2b44 100644
--- a/hydra/modules/sysadmin/services.scm
+++ b/hydra/modules/sysadmin/services.scm
@@ -110,9 +110,7 @@
                               ((guix config) => ,(make-config.scm)))
        #~(begin
            (use-modules (ice-9 ftw)
-                        (srfi srfi-1)
-                        (guix store)
-                        (guix derivations))
+                        (srfi srfi-1))
 
            (define %roots-directory
              "/var/guix/profiles/per-user/cuirass/cuirass")
@@ -157,28 +155,6 @@
                      deleted))
                  deleted))
 
-           (define (root-target root)
-             ;; Return the store item ROOT refers to.
-             (string-append (%store-prefix) "/" (basename root)))
-
-           (define (derivation-referrers store item)
-             ;; Return the referrers of the derivers of ITEM.
-             (let* ((derivers  (valid-derivers store item))
-                    (referrers (append-map (lambda (drv)
-                                             (referrers store drv))
-                                           derivers)))
-               (delete-duplicates referrers)))
-
-           (define (delete-gc-root-for-derivation drv)
-             ;; Delete the GC root for DRV, if any.
-             (catch 'system-error
-               (lambda ()
-                 (let ((item (derivation-path->output-path drv)))
-                   (delete-file
-                    (string-append %roots-directory
-                                   "/" (basename drv)))))
-               (const #f)))
-
            ;; Note: 'scandir' would introduce too much overhead due
            ;; to the large number of entries that it would sort.
            (define deleted
@@ -197,17 +173,7 @@
                (for-each (lambda (file)
                            (display file port)
                            (newline port))
-                         deleted)))
-
-           ;; Since we run 'guix-daemon --gc-keep-outputs
-           ;; --gc-keep-derivations', also remove GC roots for the outputs of
-           ;; derivations that refer to the derivers of DELETED.
-           (for-each delete-gc-root-for-derivation
-                     (with-store store
-                       (append-map (lambda (root)
-                                     (derivation-referrers
-                                      store (root-target root)))
-                                   deleted))))))))
+                         deleted))))))))
 
 (define (gc-jobs threshold)
   "Return the garbage collection mcron jobs.  The garbage collection
@@ -251,8 +217,7 @@ collection instead."
 
    (build-accounts (* build-accounts-to-max-jobs-ratio max-jobs))
    (extra-options (list "--max-jobs" (number->string max-jobs)
-                        "--cores" (number->string cores)
-                        "--gc-keep-outputs" "--gc-keep-derivations"))))
+                        "--cores" (number->string cores)))))
 
 \f
 ;;;

  parent reply	other threads:[~2023-10-10 15:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 12:36 bug#54447: cuirass: missing derivation error Mathieu Othacehe
2022-08-10  9:43 ` Maxime Devos
2022-08-10 15:30   ` Maxime Devos
2022-12-10 10:57 ` Ludovic Courtès
2023-10-15 20:21   ` Ludovic Courtès
2023-10-15 20:34     ` Ludovic Courtès
2023-08-22  3:38 ` Maxim Cournoyer
2023-08-22 20:38   ` Ludovic Courtès
2023-08-30 12:17   ` 宋文武 via Bug reports for GNU Guix
2023-10-11  3:21     ` Maxim Cournoyer
2023-10-15 16:45       ` Ludovic Courtès
2023-10-16 13:25         ` Maxim Cournoyer
2023-10-16 17:39           ` Ludovic Courtès
2023-11-20 19:09         ` Maxim Cournoyer
2023-10-10 15:52 ` Ludovic Courtès [this message]
2023-10-11  3:08   ` Maxim Cournoyer
2023-10-15 20:42   ` Ludovic Courtès
2023-10-16 17:44   ` Ludovic Courtès
2024-04-04 21:33     ` Ludovic Courtès
2024-04-14  0:15 ` John Kehayias via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0m2v5ih.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=54447@debbugs.gnu.org \
    --cc=guix-sysadmin@gnu.org \
    --cc=othacehe@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).