unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: guix-devel <guix-devel@gnu.org>
Subject: shepherd, fibers, and signals (asyncs)
Date: Fri, 15 Dec 2023 22:03:21 +0000	[thread overview]
Message-ID: <hCJrvNrwbTiY4KXyZlMS9SgA51rWy927Vv4eFsgBRy_Ll_LQX8e4s6VNjovaVWTn8TKFXG1-6EffJHlbYjKzdb_AuAoNxVqyJ8DYIa9axC0=@lendvai.name> (raw)

dear Guix,

context:

Shepherd stops responding during "guix system reconfigure"
https://issues.guix.gnu.org/67538
https://issues.guix.gnu.org/65178
https://issues.guix.gnu.org/67230

i've added a ton of logging and asserts in my fork:

https://codeberg.org/attila-lendvai-patches/shepherd

which resulted in this report:

https://github.com/wingo/fibers/issues/29#issuecomment-1858319291

to which @emixa-d kindly responded:

https://github.com/wingo/fibers/issues/29#issuecomment-1858497720

which essentially identifies the following:

--------------

posix signal handlers are  async, and shepherd uses the fibers API from inside signal handlers, specifically in at least handle-SIGCHLD.

this violates the fibers API, and most probably leads to the root cause of the reconfigure hang: a match-error flying out from service-controller due to losing the value of the parameter called (current-process-monitor), which then makes that fiber exit.

i have little experience with posix signal handlers, so i probably won't come up with a fix for this, or at least not without someone's bird's eye view guidance.

maybe the solution could be something like packaging up posix signals and delivering them to the fibers universe by some form of polling of an atomic variable? or is there some signal-safe semaphore facility in guile that could be used in accordance with the fibers API?

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Virtue is never left to stand alone. He who has it will have neighbors.”
	— Confucius (551–479 BC)



             reply	other threads:[~2023-12-15 22:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 22:03 Attila Lendvai [this message]
2023-12-17  0:59 ` shepherd, fibers, and signals (asyncs) Attila Lendvai
2024-01-09 19:29 ` Ludovic Courtès

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='hCJrvNrwbTiY4KXyZlMS9SgA51rWy927Vv4eFsgBRy_Ll_LQX8e4s6VNjovaVWTn8TKFXG1-6EffJHlbYjKzdb_AuAoNxVqyJ8DYIa9axC0=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=guix-devel@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).