Wrong request ID on API middleware filters

Bug #1960329 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Gorka Eguileor
Wallaby
Confirmed
Medium
Unassigned
Xena
Confirmed
Medium
Unassigned

Bug Description

If we change the "default_log_levels" config option to enable debug logging for any of the middleware filters used by Cinder, such as "keystonemiddleware" then the request ID is wrong (reusing an old one) in its log entries and the request ID changes to the right one later on.

This makes it hard to follow the execution on the logs, since we have 2 different request IDs for the same request.

Tags: api
Changed in cinder:
status: New → In Progress
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/827860
Committed: https://opendev.org/openstack/cinder/commit/18b8033b6bd1945bd27b03b779a32a883df5fb10
Submitter: "Zuul (22348)"
Branch: master

commit 18b8033b6bd1945bd27b03b779a32a883df5fb10
Author: Gorka Eguileor <email address hidden>
Date: Fri Feb 4 12:42:25 2022 +0100

    Fix request id mess on Cinder-API

    This patch fixes multiple issues related to request ids:

    - Duplicated request ID in logs
    - Missing request id header in response
    - Wrong request ID in response header when using noauth

    The source of these issues is the fact that the request ID and the
    request context are set too late, or not at all, in the paste filter
    chain.

    And the last bug is fixed as a freebie when the code in auth.py is
    refactored to reduce code duplication on setting the cinder.context key
    in the request's environment.

    The patch fixes these issue by changing the filter chains to have the
    request_id filter as the first filter, and using our own filter for it,
    to ensure that the context is correctly set.

    Not sure if values now defined in ENV_OVERWRITES are still necessary,
    so the patch preserves current behavior.

    Closes-Bug: #1960019
    Closes-Bug: #1960020
    Closes-Bug: #1960021
    Closes-Bug: #1960329
    Change-Id: Ide831a221a7561bbb7da193f0edb011f1989420e

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 20.0.0.0rc1

This issue was fixed in the openstack/cinder 20.0.0.0rc1 release candidate.

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.