Sometimes CloudControl will indicate a transient problem due to resource contention by returning RESOURCE_BUSY. If that happens we should be able to retry operations.
For example, deploying a VLAN while another VLAN is being deployed for the same organisation will result in RESOURCE_BUSY. The provider should be able to retry the operation until it succeeds or times out.
[x] Retry mechanism
[x] Provider settings
[x] Retry period
[x] Retry timeout
[x] ddcloud_vlan
[x] Create
[x] Delete
[x] ddcloud_networkdomain
[x] Create
[x] Delete
[x] ddcloud_nat
[x] Create
[x] Delete
[x] ddcloud_firewall_rule
[x] Create
[x] Delete
Let's do something like:
var apiClient *compute.Client
var result string
err := retry.Action("Deploy VLAN", 3 * time.Minute, func(context retry.Context) {
var e error
result, e := apiClient.DeployVLAN(name, description, baseAddress, prefixSize)
if e != nil {
context.Fail(e)
return
}
if isBusy(result) {
context.Retry()
}
}
if err != nil {
return "", err
}
return result, nil
Sometimes CloudControl will indicate a transient problem due to resource contention by returning
RESOURCE_BUSY
. If that happens we should be able to retry operations.For example, deploying a VLAN while another VLAN is being deployed for the same organisation will result in
RESOURCE_BUSY
. The provider should be able to retry the operation until it succeeds or times out.ddcloud_vlan
ddcloud_networkdomain
ddcloud_nat
ddcloud_firewall_rule
Let's do something like: