Skip to content

Commit bb2c24f

Browse files
committed
fix(runner): expose sanitized probe failure
1 parent 738a825 commit bb2c24f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎services/hosted-runner/src/privsep-broker.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ async function runProbe(state: BrokerState) {
390390

391391
const probeScript = String.raw`
392392
set -euo pipefail
393+
trap 'printf "probeFailure=line-%s\n" "$LINENO" >&2' ERR
393394
workspace="$1"
394395
credential="$2"
395396
runner_pid="$3"
@@ -529,6 +530,15 @@ async function handleControl(
529530
}
530531
}
531532
} catch (error) {
533+
if (request.operation === "probe") {
534+
const failure =
535+
error instanceof Error
536+
? error.message.match(/probeFailure=(line-\d{1,4})/u)?.[1]
537+
: undefined;
538+
console.error("CounterLab privilege broker probe failed", {
539+
reason: failure ?? "probe-execution-failed",
540+
});
541+
}
532542
const code =
533543
error instanceof Error && error.message === "LAUNCH_LIMIT_REACHED"
534544
? "LAUNCH_LIMIT_REACHED"

0 commit comments

Comments
 (0)