bug#67839: shepherd: sometimes hangs on `guix system reconfigure`

2023-12-17 Thread Ludovic Courtès
Hi Attila,

Attila Lendvai  skribis:

> * modules/shepherd.scm (main): Switch with-service-registry and
> with-process-monitor.  This way the parameterize of the process monitor covers
> everything else.  This fixes the bug that caused `guix system reconfigure` to
> hang in certain situations.  Fix proposed by @emixa-d at:
> https://github.com/wingo/fibers/issues/29#issuecomment-1858922276.

[...]

> * modules/shepherd/service.scm (spawn-service-controller): Add two asserts.
> This is the bug that causes `guix system reconfigure ...` to sometimes hang,
> and subsequently all shepherd commands, because a match-error flies out from
> the service-controller of a replaced service, and thus its fiber dies.  These
> asserts get triggered without the previous commit that fixes the issue.

Good catch!!

I pushed these patches with small edits, in particular adding a test
that reproduces the bug without relying on assertion failures:

  5dbde1c support: ‘assert’ logs source location information.
  0bcf02a Update NEWS.
  c07f0a8 service: Add asserts to ensure a process monitor is running.
  9be0b7e shepherd: Make sure ‘with-process-monitor’ covers everything needed.

Thanks for the tedious but fruitful debugging work!

Ludo’.





bug#67839: shepherd: sometimes hangs on `guix system reconfigure`

2023-12-15 Thread Attila Lendvai
my fellow hackers,

i'm going to attach two patches that is essentially just adding a couple of 
asserts that trigger a test failure (tests/replacement.sh).

my current codebase 
(https://codeberg.org/attila-lendvai-patches/shepherd/commits/branch/attila) 
logs a whole lot more information, and has a more sophisticated error handling. 
triggering the same error on that codebase shows that the first assert is 
already failing (the one that is before spawning the new fiber for the 
controller of the replacement).

maybe the root cause is this: https://github.com/wingo/fibers/issues/29

HTH,

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Angry people want you to see how powerful they are… loving people want you to 
see how powerful You are.”
— Chief Red Eagle