Skip to content

Commit 565daae

Browse files
sharpninjaclaude
andcommitted
Fix benchmark pipeline hang: force exit after report generation
The benchmark-report command hangs indefinitely after BenchmarkDotNet and report generation complete because the Microsoft.Agents.AI hosting framework leaves non-daemon threads running that prevent the process from exiting. On self-hosted agents with no job timeout (default 0), this causes the pipeline run to hang until manually cancelled. Two fixes: - Add Environment.Exit(0) after benchmark-report completes to kill lingering hosting threads - Add timeoutInMinutes: 45 to the benchmark job as a safety net Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8585ba4 commit 565daae

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

azure-pipelines-benchmark-report.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ stages:
2323
jobs:
2424
- job: benchmark
2525
displayName: Run slow-lane validation and generate report
26+
timeoutInMinutes: 45
2627
pool:
2728
name: Default
28-
timeoutInMinutes: 0
2929
steps:
3030
- checkout: self
3131

@@ -75,7 +75,6 @@ stages:
7575
displayName: Deploy static benchmark site
7676
pool:
7777
name: Default
78-
timeoutInMinutes: 0
7978
steps:
8079
- checkout: none
8180

src/BitNetSharp.App/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
reportDirectory,
2828
commitHash);
2929
Console.WriteLine($"Saved benchmark comparison report to {outputPath}");
30+
31+
// Force exit: BenchmarkDotNet and the Microsoft.Agents.AI hosting framework
32+
// may leave non-daemon threads running that prevent the process from exiting
33+
// cleanly, causing CI pipeline jobs to hang indefinitely on self-hosted agents.
34+
Environment.Exit(0);
3035
return;
3136
}
3237

0 commit comments

Comments
 (0)