Cinder Backup is incorrectly logging request ids

Bug #1743461 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Gorka Eguileor

Bug Description

Currently all log entries will have the request ID of the latest request that was received in the Backup service.

So you would receive a request with ID 1 and you would start logging that thread log calls with its ID, but as soon as you receive another request, let's say with ID 2, you will have both request logging with ID 2 instead of each one logging with its own request ID.

Gorka Eguileor (gorka)
Changed in cinder:
assignee: nobody → Gorka Eguileor (gorka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/533794

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/533794
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=1a569e15c35d772a8ca236d75cd1840a415983d3
Submitter: Zuul
Branch: master

commit 1a569e15c35d772a8ca236d75cd1840a415983d3
Author: Gorka Eguileor <email address hidden>
Date: Mon Jan 15 21:29:02 2018 +0100

    Fix Backup uses latest req-id for all log calls

    Currently all log entries will have the request ID of the latest request
    that was received in the Backup service.

    So you would receive a request with ID 1 and you would start logging
    that thread log calls with its ID, but as soon as you receive another
    request, let's say with ID 2, you will have both request logging with ID
    2 instead of each one logging with its own request ID.

    The reason for this is that we are monkey patching after we have
    imported OSLO logging and we should be doing the monkey patching before,
    because OSLO logging imports OSLO context, which in turn imports
    threading and defines the _request_store where the context is stored as
    threading.local, which is not the monkey patched version and therefore
    will be shared among all the greenthreads that share the same python
    thread.

    To fix this we just move the monkey patching earlier in the imports.

    Closes-Bug: #1743461
    Change-Id: I677a8e39de4292fe4fa8e70d7b6ae2fc3d5cf2ac

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/537001

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/pike)

Reviewed: https://review.openstack.org/537001
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=06fb04a040db7a90f19fea8d3b928fbba5cf9582
Submitter: Zuul
Branch: stable/pike

commit 06fb04a040db7a90f19fea8d3b928fbba5cf9582
Author: Gorka Eguileor <email address hidden>
Date: Mon Jan 15 21:29:02 2018 +0100

    Fix Backup uses latest req-id for all log calls

    Currently all log entries will have the request ID of the latest request
    that was received in the Backup service.

    So you would receive a request with ID 1 and you would start logging
    that thread log calls with its ID, but as soon as you receive another
    request, let's say with ID 2, you will have both request logging with ID
    2 instead of each one logging with its own request ID.

    The reason for this is that we are monkey patching after we have
    imported OSLO logging and we should be doing the monkey patching before,
    because OSLO logging imports OSLO context, which in turn imports
    threading and defines the _request_store where the context is stored as
    threading.local, which is not the monkey patched version and therefore
    will be shared among all the greenthreads that share the same python
    thread.

    To fix this we just move the monkey patching earlier in the imports.

    Closes-Bug: #1743461
    Change-Id: I677a8e39de4292fe4fa8e70d7b6ae2fc3d5cf2ac
    (cherry picked from commit 1a569e15c35d772a8ca236d75cd1840a415983d3)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0b3

This issue was fixed in the openstack/cinder 12.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.1.0

This issue was fixed in the openstack/cinder 11.1.0 release.

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.