Glance client does not correctly forward global request IDs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance Client |
Fix Released
|
Medium
|
Erno Kuvaja | ||
Train |
Triaged
|
Medium
|
Erno Kuvaja | ||
Ussuri |
Triaged
|
Medium
|
Erno Kuvaja | ||
Victoria |
Fix Released
|
Medium
|
Erno Kuvaja |
Bug Description
This is about the Global Request ID functionality of OpenStack [1].
When the Glance client is used to instantiate a client object for
accessing the Glance API, a global_request_id parameter may be
passed to it. However, due to a coding error in the SessionClient
class, the parameter never reaches the Glance API in form of the
"X-Openstack-
# How to reproduce
This can be reproduced simply by creating a server in Nova from an
image in Glance, which will attempt to create the Glance client
instance using the global_request_id [5]. Passing the
"X-Openstack-
server creation, makes it visible in Nova (using a suitable
"logging_
Glance. Using a Python debugger shows Glance generating a new local ID
instead.
Example for a "logging_
logging_
Note: due to another bug in Glance API, currently the global request
id will never actually show up as %(global_
but will instead be shown as the %(request_id)s if available, i.e. when
this client bug gets fixed, a global id will show up in the logs as if
it was a local one until the API bug is fixed too. So expect different
behavior when applying this logging setting to both Nova and Glance!
# Technical details
When the SessionClient class is used, the global_request_id is removed
from kwargs in the constructor using pop() [2]. Directly after this,
the parent constructor is called using super(), which in this case is
Adapter from the keystoneauth1 library. Therein the global_request_id
is set again [3] but since it has been removed from the kwargs, it
defaults to None as specified in the Adapter's __init__() header. Thus,
the global_request_id passed to the SessionClient constructor never
actually makes it to the Glance API. This is in contrast to the
HTTPClient class, where get() is used instead of pop() [4].
# Proposed solution
Replace pop() by get() in the code of SessionClient referenced above.
# Link references
[1] https:/
[2] https:/
[3] https:/
[4] https:/
[5] https:/
Changed in python-glanceclient: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Erno Kuvaja (jokke) |
Fix proposed to branch: master /review. opendev. org/740821
Review: https:/