Skip to content

Commit 5f42221

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Protect the "standardattr" retrieval from a concurrent deletion" into stable/2023.1
2 parents 2e23899 + bb9a433 commit 5f42221

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

neutron/services/tag/tag_plugin.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,17 @@ def __new__(cls, *args, **kwargs):
4747
def _extend_tags_dict(response_data, db_data):
4848
if not directory.get_plugin(tagging.TAG_PLUGIN_TYPE):
4949
return
50-
tags = [tag_db.tag for tag_db in db_data.standard_attr.tags]
50+
try:
51+
tags = [tag_db.tag for tag_db in db_data.standard_attr.tags]
52+
except AttributeError:
53+
# NOTE(ralonsoh): this method can be called from a "list"
54+
# operation. If one resource and its "standardattr" register is
55+
# deleted concurrently, the "standard_attr" field retrieval will
56+
# fail.
57+
# The "list" operation is protected with a READER transaction
58+
# context; however this is failing with the DB PostgreSQL backend.
59+
# https://bugs.launchpad.net/neutron/+bug/2078787
60+
tags = []
5161
response_data['tags'] = tags
5262

5363
@db_api.CONTEXT_READER

0 commit comments

Comments
 (0)