Adapter request send two header for global request-id

Bug #1881351 reported by Ghanshyam Mann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystoneauth
Fix Released
Undecided
Ghanshyam Mann

Bug Description

Adapter request send two global request id header "X-OpenStack-Request-ID" and "X-Openstack-Request-Id".
example: https://zuul.opendev.org/t/openstack/build/c5b1debf78df4aa3bdda34f0b4c53c37/log/testrepository.subunit#2385

This is becasue of the different header name in when adaptor add or when session request add it, differnce it with cap 'D'.

Adapter add the header 'X-OpenStack-Request-ID' with cap 'D'
- https://github.com/openstack/keystoneauth/blob/5e5185f80f7ecb05b43a1c635d1cdba3cc733660/keystoneauth1/adapter.py#L243

which is supposed to be override by sessions reqeust if global request id is send there, but it does not because it add it as 'X-OpenStack-Request-Id' small 'd'
- https://github.com/openstack/keystoneauth/blob/5e5185f80f7ecb05b43a1c635d1cdba3cc733660/keystoneauth1/session.py#L858

And unit test of request global-request-id has precedence over adapter fail because of how different python version treat the dict. py3.6 and above are all good as dict maintain the insertion ordered but py3.5 can fail it any time.
- https://zuul.opendev.org/t/openstack/build/c5b1debf78df4aa3bdda34f0b4c53c37/log/testrepository.subunit#2385

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystoneauth (master)

Fix proposed to branch: master
Review: https://review.opendev.org/731847

Changed in keystoneauth:
assignee: nobody → Ghanshyam Mann (ghanshyammann)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystoneauth (master)

Reviewed: https://review.opendev.org/731847
Committed: https://git.openstack.org/cgit/openstack/keystoneauth/commit/?id=c00fca4a09942181937794d711643511e3b1e4a5
Submitter: Zuul
Branch: master

commit c00fca4a09942181937794d711643511e3b1e4a5
Author: Ghanshyam Mann <email address hidden>
Date: Fri May 29 16:04:47 2020 -0500

    Make header Case Insensitive

    In case of global-request-id request, Adapter
    send two global request id header
     - "X-OpenStack-Request-ID"
     - "X-Openstack-Request-Id".

    Example: https://zuul.opendev.org/t/openstack/build/c5b1debf78df4aa3bdda34f0b4c53c37/log/testrepository.subunit#2385

    This is becasue of the header not being Case Insensitive
    and end up with two different name of same header with difference
    of cap 'D'.

    Unit test for whether request global-request-id has precedence
    over adapter fail many times because of how different python version
    treat the dict. py3.6 and above are all good as dict maintain the
    insertion ordered but py3.5 can fail it any time.

    We can see consistent failure in py35 jobs:
    - https://review.opendev.org/#/c/730687/

    Let's make the headers always Case Insensitive which is
    what RFC says.

    Change-Id: Iba707dd0506d22e144aca4fdfc9b140c8e37ae02
    Closes-Bug: #1881351

Changed in keystoneauth:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.