Skip to content

Commit 72fb120

Browse files
yycpttmindaugasrukas
authored andcommitted
Use lowest persistence priority for standby tasks (#4551)
1 parent ca41bb0 commit 72fb120

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

service/history/queues/executor_wrapper.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ package queues
2727
import (
2828
"context"
2929

30+
"go.temporal.io/server/common/headers"
3031
"go.temporal.io/server/common/log"
3132
"go.temporal.io/server/common/log/tag"
3233
"go.temporal.io/server/common/metrics"
@@ -67,7 +68,11 @@ func (e *executorWrapper) Execute(
6768
return e.activeExecutor.Execute(ctx, executable)
6869
}
6970

70-
return e.standbyExecutor.Execute(ctx, executable)
71+
// for standby tasks, use preemptable callerType to avoid impacting active traffic
72+
return e.standbyExecutor.Execute(
73+
headers.SetCallerType(ctx, headers.CallerTypePreemptable),
74+
executable,
75+
)
7176
}
7277

7378
func (e *executorWrapper) isActiveTask(

0 commit comments

Comments
 (0)