Enable backoff/retries on scaling up

- this change is needed for Docker Swarm which may give an error
when several concurrent requests come in to scale a deployment.

Tested on Docker Swarm before/after with the hey tool and figlet
scaled down to zero replicas.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (VMware)
2018-11-05 20:30:42 +00:00
committed by Alex Ellis
parent 446c8672ae
commit 117707df14
3 changed files with 51 additions and 6 deletions

View File

@ -9,7 +9,8 @@ type ScalingConfig struct {
// MaxPollCount attempts to query a function before giving up
MaxPollCount uint
// FunctionPollInterval delay or interval between polling a function's readiness status
// FunctionPollInterval delay or interval between polling a function's
// readiness status
FunctionPollInterval time.Duration
// CacheExpiry life-time for a cache entry before considering invalid
@ -17,4 +18,8 @@ type ScalingConfig struct {
// ServiceQuery queries available/ready replicas for function
ServiceQuery ServiceQuery
// SetScaleRetries is the number of times to try scaling a function before
// giving up due to errors
SetScaleRetries uint
}