Skip to content

Commit

Permalink
Increase the handling of 409 errors when node creation fails
Browse files Browse the repository at this point in the history
When creating a node with a 409 error, try again later.

Signed-off-by: Zhou Hao <zhouhao@fujitsu.com>
  • Loading branch information
zhouhao3 committed Jul 28, 2022
1 parent 554b246 commit 87a4c45
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/provisioner/ironic/ironic.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,17 @@ func (p *ironicProvisioner) ValidateManagementAccess(data provisioner.Management
"capabilities": bootModeCapabilities[data.BootMode],
},
}).Extract()
// FIXME(dhellmann): Handle 409 and 503? errors here.
if err != nil {
switch err.(type) {
case nil:
p.publisher("Registered", "Registered new host")
case gophercloud.ErrDefault409:
p.log.Info("could not register host in ironic, busy")
result, err = retryAfterDelay(provisionRequeueDelay)
return
default:
result, err = transientError(errors.Wrap(err, "failed to register host in ironic"))
return
}
p.publisher("Registered", "Registered new host")

// Store the ID so other methods can assume it is set and so
// we can find the node again later.
Expand Down

0 comments on commit 87a4c45

Please sign in to comment.