Skip to content

Retry create_additional_port_for_machines on ConnectionTimeout#1379

Closed
dosaboy wants to merge 1 commit into
openstack-charmers:masterfrom
dosaboy:allow-configure-networks-retry
Closed

Retry create_additional_port_for_machines on ConnectionTimeout#1379
dosaboy wants to merge 1 commit into
openstack-charmers:masterfrom
dosaboy:allow-configure-networks-retry

Conversation

@dosaboy

@dosaboy dosaboy commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

If this is called when keystone services are for whatever reason being restarted a timeout occurs and a retry generally works.

@xtrusia xtrusia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Maybe better to add a stop condition though, e.g. stop=tenacity.stop_after_attempt(10)

@dosaboy

dosaboy commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

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.
@dosaboy
dosaboy force-pushed the allow-configure-networks-retry branch from b807068 to ca72dd4 Compare June 12, 2026 11:26
@dosaboy

dosaboy commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

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))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 1034 to 1036
port = neutronclient.create_port(body=body_value)
server.interface_attach(port_id=port['port']['id'],
net_id=None, fixed_ip=None)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dosaboy

dosaboy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

on reflection I dont think this is needed and the root issue was actually resolved by #1409.

@dosaboy dosaboy closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants