Skip to content

Commit c7dae2d

Browse files
committed
fix(worker-runner): poll azure metadata service every second
1 parent 51bc124 commit c7dae2d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
audience: worker-deployers
2+
level: patch
3+
---
4+
Worker Runner/Generic Worker (Azure): polls the metadata service for events the worker should gracefully terminate on every second (down from 15s). This frequency is recommended by Microsoft [here](https://learn.microsoft.com/en-us/azure/virtual-machines/windows/scheduled-events#polling-frequency) and will hopefully reduce tasks resolving as `claim-expired`.

tools/worker-runner/provider/azure/azure.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ func (p *AzureProvider) WorkerStarted(state *run.State) error {
154154
p.proto.AddCapability("graceful-termination")
155155

156156
// start polling for graceful shutdown
157-
p.terminationTicker = time.NewTicker(15 * time.Second)
157+
// Microsoft recommends once per second
158+
// https://learn.microsoft.com/en-us/azure/virtual-machines/windows/scheduled-events#polling-frequency
159+
p.terminationTicker = time.NewTicker(1 * time.Second)
158160
go func() {
159161
for {
160162
<-p.terminationTicker.C

0 commit comments

Comments
 (0)