fn: New timeout for LB Placer (#1137)

* fn: New timeout for LB Placer

Previously, LB Placers worked hard as long as
client contexts allowed for. Adding a Placer
config setting to bound this by 360 seconds by
default.

The new timeout is not accounted during actual
function execution and only applies to the amount
of wait time in Placers when the call is not
being executed.
This commit is contained in:
Tolga Ceylan
2018-07-26 10:19:25 -07:00
committed by GitHub
parent f7266c4f19
commit 9f29d824d6
8 changed files with 185 additions and 113 deletions

View File

@@ -586,12 +586,13 @@ func WithAgentFromEnv() Option {
}
// Select the placement algorithm
placerCfg := pool.NewPlacerConfig()
var placer pool.Placer
switch getEnv(EnvLBPlacementAlg, "") {
case "ch":
placer = pool.NewCHPlacer()
placer = pool.NewCHPlacer(&placerCfg)
default:
placer = pool.NewNaivePlacer()
placer = pool.NewNaivePlacer(&placerCfg)
}
keys := []string{"fn_appname", "fn_path"}