[placement] reorder middleware to correct logging context
The initial bug was that the initial 'Starting' log provided by
requestlog had a different request id from the rest of the log
messages for the same request. The initial assumption was that this
was because a request id was not initially available, causing one
to be generated for the first log entry that later was replaced
by the request id middleware.
In the process of debugging that it became clear that the id was
in fact the request id of the previous request because the context
was being reused under the covers in oslo_log and olso_context.
Therefore the auth, context and request id middlewares are now
changed to be active in the middleware stack before the request log
middleware. The unfortunate side effect of this is that the Starting
message and final request logging is no longer actually bounding the
full request: it misses three critical middlewares.
Reviewed: https:/ /review. openstack. org/374833 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=0b9b8981f28 02f21999325e028 605157f0b1f11d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0b9b8981f2802f2 1999325e0286051 57f0b1f11d
Author: Chris Dent <email address hidden>
Date: Thu Sep 22 13:47:49 2016 +0000
[placement] reorder middleware to correct logging context
The initial bug was that the initial 'Starting' log provided by
requestlog had a different request id from the rest of the log
messages for the same request. The initial assumption was that this
was because a request id was not initially available, causing one
to be generated for the first log entry that later was replaced
by the request id middleware.
In the process of debugging that it became clear that the id was
in fact the request id of the previous request because the context
was being reused under the covers in oslo_log and olso_context.
Therefore the auth, context and request id middlewares are now
changed to be active in the middleware stack before the request log
middleware. The unfortunate side effect of this is that the Starting
message and final request logging is no longer actually bounding the
full request: it misses three critical middlewares.
Change-Id: Ifa412973037193 e4e67a0c9d2c71c 7a4847980a9
Closes-Bug: #1626493