From f2ebc1a2ef0d7c991dc0aef9ac9454149b49dddd Mon Sep 17 00:00:00 2001 From: sk593 Date: Thu, 27 Aug 2026 08:37:44 -0700 Subject: [PATCH] Bound bicep download with a timeout in the PowerShell installer `rad bicep download` streams a large (~110MB) binary with no client-side timeout, so a stalled network transfer hangs install.ps1 indefinitely. This surfaces as the Validate PowerShell Installer CI job burning its full 10-minute budget at "Installing bicep..." and being cancelled. bicep is optional (its failure is already non-fatal), so run `rad bicep download` as a child process bounded by a 300s timeout: on timeout, stop the process, warn, and continue rather than hanging. This is a script-level mitigation. The underlying missing HTTP timeout in the rad CLI's bicep download (pkg/cli/bicep/tools/download_tools.go) is tracked separately. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: sk593 --- deploy/install.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/deploy/install.ps1 b/deploy/install.ps1 index 0c2bf67311e..74ae74f8daf 100755 --- a/deploy/install.ps1 +++ b/deploy/install.ps1 @@ -544,8 +544,19 @@ Write-Output "$cliFileName installed into $resolvedInstallDir successfully" # Install bicep Write-Output "" Write-Output "Installing bicep..." -& $cliFilePath bicep download -if ($LASTEXITCODE -ne 0) { + +# Bound the bicep download with a timeout. bicep is optional (a failure here is +# non-fatal), and `rad bicep download` streams a large binary with no client-side +# timeout, so a stalled network transfer can otherwise hang the installer +# indefinitely. On timeout we stop the process, warn, and continue. +$bicepTimeoutSeconds = 300 +$bicepProcess = Start-Process -FilePath $cliFilePath -ArgumentList 'bicep', 'download' -NoNewWindow -PassThru +$bicepProcess | Wait-Process -Timeout $bicepTimeoutSeconds -ErrorAction SilentlyContinue +if (-not $bicepProcess.HasExited) { + $bicepProcess | Stop-Process -Force -ErrorAction SilentlyContinue + Write-Warning "Timed out installing bicep after $bicepTimeoutSeconds seconds" +} +elseif ($bicepProcess.ExitCode -ne 0) { Write-Warning "Failed to install bicep" } else {