Skip to content

Commit 2fa759e

Browse files
author
Chloe Hutchinson
committed
Remove sleep, increase app restart delay to resolve race condition
1 parent 31182c7 commit 2fa759e

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

packer/windows/conf/bin/bk-install-elastic-stack.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ nssm set buildkite-agent AppEnvironmentExtra :HOME=C:\buildkite-agent
170170
If ($lastexitcode -ne 0) { Exit $lastexitcode }
171171
nssm set buildkite-agent AppExit Default Restart
172172
If ($lastexitcode -ne 0) { Exit $lastexitcode }
173-
nssm set buildkite-agent AppRestartDelay 5000
173+
nssm set buildkite-agent AppRestartDelay 10000
174174
If ($lastexitcode -ne 0) { Exit $lastexitcode }
175175
nssm set buildkite-agent AppEvents Exit/Post "powershell C:\buildkite-agent\bin\terminate-instance.ps1"
176176
If ($lastexitcode -ne 0) { Exit $lastexitcode }

packer/windows/conf/buildkite-agent/scripts/terminate-instance.ps1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
Write-Output "terminate-instance: waiting for 10 seconds to allow agent logs to drain to Cloudwatch..."
2-
Start-Sleep -Seconds 10
3-
41
$InstanceId = (Invoke-WebRequest -UseBasicParsing http://169.254.169.254/latest/meta-data/instance-id).content
52
$Region = (Invoke-WebRequest -UseBasicParsing http://169.254.169.254/latest/meta-data/placement/availability-zone).content -replace ".$"
63

0 commit comments

Comments
 (0)