PC 1, 22:31 UTC: the installed engine's quit hung 24 minutes in the jobs runner's abort, waiting for EOF on the script's stdout pipe whose write end the second engine and its miners had inherited (Process.Start with redirection inherits every inheritable handle), while the orphaned miners mined on against the relaunched app. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
24 lines
1.9 KiB
Bash
Executable file
24 lines
1.9 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# The second-engine class (C35, 5 October 2026, PC 1 22:31 UTC): a playbook started a second Igneum engine beside the
|
|
# installed app through a redirected PIPE (PowerShell's Process.Start with RedirectStandardOutput). A pipe's write end is
|
|
# inherited by every process the engine starts (its miners and workers); when the job was aborted, the installed app's
|
|
# jobs runner waited for an EOF the orphaned grandchildren never sent and its quit hung for 24 minutes, and the second
|
|
# engine's miners mined on against the relaunched app. Rule for every playbook that starts an engine: (1) the engine's
|
|
# output goes to a FILE (Start-Process -RedirectStandardOutput <file>), never a pipe into the script; (2) the engine's
|
|
# whole process tree is ended at the end and on the budget (taskkill /T /F), so nothing is orphaned; the installed
|
|
# app's miners come back only after that (the job runner restarts them when the script ends). This check fails CI when
|
|
# a playbook starts an engine without both.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/../.."
|
|
fail=0
|
|
while IFS= read -r f; do
|
|
grep -qE "igneum-app(\.exe)?['\"]? *(--sweep|-ArgumentList '--sweep'|--no-open)|ArgumentList '--sweep'|\.Arguments = '--sweep'" "$f" || continue
|
|
if grep -qE 'RedirectStandardOutput *= *\$true|UseShellExecute *= *\$false|Register-ObjectEvent|BeginOutputReadLine' "$f"; then
|
|
echo "second-engine: $f starts an engine through a pipe (RedirectStandardOutput/BeginOutputReadLine); use Start-Process -RedirectStandardOutput <file>"; fail=1
|
|
fi
|
|
if ! grep -qE 'taskkill /T /F' "$f"; then
|
|
echo "second-engine: $f starts an engine without ending its process tree (taskkill /T /F) at the end"; fail=1
|
|
fi
|
|
done < <(git ls-files 'relay/playbooks/**' 'tools/windows/**' 'packaging/**' | grep -E '\.ps1$')
|
|
[ "$fail" = 0 ] && echo "second-engine: every playbook that starts an engine logs to a file and ends its tree"
|
|
exit $fail
|