Retry create_additional_port_for_machines on ConnectionTimeout#1379
Retry create_additional_port_for_machines on ConnectionTimeout#1379dosaboy wants to merge 1 commit into
Conversation
xtrusia
left a comment
There was a problem hiding this comment.
LGTM
Maybe better to add a stop condition though, e.g. stop=tenacity.stop_after_attempt(10)
ack ill add that |
If this is called when keystone services are for whatever reason being restarted a timeout occurs and a retry generally works.
b807068 to
ca72dd4
Compare
|
im not sure this is fixing the issue it is intended to so needs a bit more testing. |
|
|
||
| @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60), | ||
| reraise=True, stop=tenacity.stop_after_attempt(10), | ||
| retry=tenacity.retry_if_exception_type(ConnectTimeout)) |
There was a problem hiding this comment.
I like the idea, and this function is already taking care of not adding more ports to the instance if it already has a port.
| port = neutronclient.create_port(body=body_value) | ||
| server.interface_attach(port_id=port['port']['id'], | ||
| net_id=None, fixed_ip=None) |
There was a problem hiding this comment.
should we treat this in a more atomic way?, in case the create_port succeeds, but the interface_attach doesn't?, in that scenario we won't reusing the already created port, because neutronclient.list_ports(device_id=server.id)['ports'], the port won't be in this list.
|
on reflection I dont think this is needed and the root issue was actually resolved by #1409. |
If this is called when keystone services are for whatever reason being restarted a timeout occurs and a retry generally works.