[Midnightbsd-cvs] [MidnightBSD/mports] c29de1: magus: empty the process group, not just reap its ...

Lucas Holt noreply at github.com
Fri Sep 11 14:36:32 EDT 2026


  Branch: refs/heads/tools/magus-make-timeout
  Home:   https://github.com/MidnightBSD/mports
  Commit: c29de16470c6a20d2e160eed830c87e9d81fb0d9
      https://github.com/MidnightBSD/mports/commit/c29de16470c6a20d2e160eed830c87e9d81fb0d9
  Author: Lucas Holt <luke at foolishgames.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M Tools/lib/Magus/PortTest.pm
    M Tools/magus/config.yaml.example
    A Tools/t/magus-porttest-timeout.t

  Log Message:
  -----------
  magus: empty the process group, not just reap its leader

Review feedback on the watchdog.

_reap_group returned as soon as waitpid() collected the group leader, so a
make that exits cleanly on SIGTERM while something it spawned ignores the
signal left that child running and skipped the KILL escalation entirely --
precisely the case the watchdog exists to handle.  Wait for the group to
empty, using kill(0, -$pid) to count survivors, and only then declare it
done.

Two smaller fixes alongside it:

- A parsed OutcomeRules diagnostic replaced the errors list wholesale, which
  could drop the MakeTimeout entry and report a timed-out phase as an
  ordinary parse failure.  Keep the timeout at the front of the merged list.
- The child ignored setsid()'s result.  If it cannot lead a process group the
  watchdog has nothing to signal, so check the invariant with getpgrp() and
  refuse to exec rather than run a build we cannot clean up.

Add Tools/t/magus-porttest-timeout.t covering the per-target limits, exit
status propagation through magus.pl's SIGCHLD reaper, a hung build with a
spawned child, a child that ignores SIGTERM, and the timeout/diagnostic
merge.  The SIGTERM case fails against the previous _reap_group.

Also note in config.yaml.example that a site's MakeTimeouts replaces the
built-in hash rather than merging with it.

AI-Assisted-by: Claude Opus 5 <noreply at anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>
Claude-Session: https://claude.ai/code/session_017JRCQA17KgZSRk2vV96wbT
Signed-off-by: Lucas Holt <luke at foolishgames.com>



To unsubscribe from these emails, change your notification settings at https://github.com/MidnightBSD/mports/settings/notifications


More information about the Midnightbsd-cvs mailing list