yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #73847
[Bug 1757407] Re: Notification sending sometimes hits the keystone API to get glance endpoints
Reviewed: https://review.openstack.org/564528
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=93b897348bde072969f67e43875ce08e5d420b8a
Submitter: Zuul
Branch: master
commit 93b897348bde072969f67e43875ce08e5d420b8a
Author: Balazs Gibizer <balazs.gibizer@xxxxxxxxxxxx>
Date: Thu Apr 26 16:55:15 2018 +0200
Call generate_image_url only for legacy notification
The legacy instance.exists notification includes the full url of the glance
image of the given instance. But the versioned notification only includes
the image uuid. Generating the full url can be a costly operation as it
needs to talk to Keystone.
So this patch makes sure that generate_image_url only called when the
generated information will be used.
Change-Id: I78c2a34b3d03438457cc968cd0a38b8131e4f6e6
Closes-Bug: #1757407
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1757407
Title:
Notification sending sometimes hits the keystone API to get glance
endpoints
Status in OpenStack Compute (nova):
Fix Released
Bug description:
During the investigation of another bug [1] we noticed that
notification sending could trigger keystone API call if the
glance/api_server config is not present in the nova.conf . The
notification sending code paths[2][3] calls info_from_instance [4]
that leads to the glance client get_api_servers function that falls
back to keystone to get the endpoints if the above config is not
present.
The versioned notifications do not use the glance endpoint
information. However even if the notifications/notification_format
config options is set to versioned, nova still hits keystone via the
instance.exists notification codepath [3] as that path is shared
between versioned and unversioned notifications.
This leads to an unnecessary REST API call where the result is not
used so the caused performance loss is totally unnecessary.
[1] https://bugs.launchpad.net/nova/+bug/1753550
[2] https://github.com/openstack/nova/blob/db0747591ce8df1b0ca62aac0648b7154fed1f86/nova/compute/utils.py#L305
[3] https://github.com/openstack/nova/blob/6eccfb7c01b7e984cb18c7b75bd20a589dfdfe3d/nova/notifications/base.py#L212
[4] https://github.com/openstack/nova/blob/6eccfb7c01b7e984cb18c7b75bd20a589dfdfe3d/nova/notifications/base.py#L381
[5] https://github.com/openstack/nova/blob/24379f1822e3ae1d4f7c8398e60af6e52b386c32/nova/image/glance.py#L126
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1757407/+subscriptions
References