From: "Ludovic Courtès" <ludo@gnu.org>
To: 31785@debbugs.gnu.org
Cc: Mathieu Othacehe <othacehe@gnu.org>
Subject: bug#31785: Multiple client 'build-paths' RPCs can lead to daemon deadlock
Date: Wed, 04 Nov 2020 16:21:39 +0100 [thread overview]
Message-ID: <87361p9mgs.fsf@gnu.org> (raw)
In-Reply-To: <87602ph0yv.fsf@gnu.org> ("Ludovic Courtès"'s message of "Mon, 11 Jun 2018 16:06:16 +0200")
Hi,
ludo@gnu.org (Ludovic Courtès) skribis:
> This comes from the fact that ‘LocalStore::buildPaths’ takes the
> user-supplied derivation list as is, without sorting it, and then
> acquires locks in that order in ‘Worker::run’.
This diagnostic is incorrect: ‘Goals’ is a set sorted according to
‘CompareGoalPtrs’, which is lexical sort that arranges so substitution
goals come before derivation goals. Thus, ‘_topGoals’ and ‘awake2’ in
Worker::run are sorted in a deterministic fashion.
The problem is that ‘Worker::waitForAWhile’ reshuffles the order of
goals by temporarily moving goals out of the way. This can happen when
offloading replies “postpone”, which is inherently non-deterministic
(which goals are put to sleep will vary from one session to another
session.)
When those goals are eventually woken up from ‘Worker::waitForInput’,
they’re reprocessed, in sorted order, but potentially with “holes”
compared to other ‘guix-daemon’ processes.
That’s only a partial explanation; we need to go further to come up with
an actual deadlock scenario.
Ludo’.
prev parent reply other threads:[~2020-11-04 15:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 14:06 bug#31785: Multiple client 'build-paths' RPCs can lead to daemon deadlock Ludovic Courtès
2019-09-06 9:04 ` Ludovic Courtès
2020-11-04 15:21 ` Ludovic Courtès [this message]
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=87361p9mgs.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=31785@debbugs.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).