commit d7bd9dc37ac3d6bc171cd2e290c772633ad20a32
Author: Chris Buccella <email address hidden>
Date: Mon Mar 10 14:54:33 2014 +0000
Don't store the request ID value in middleware as class variable
The original version of the request_id middleware generates a request ID during
process_request() and stores the value in a variable, so it can be attached as
header in process_request(). This is pretty dangerous, since subsequent
requests will overwrite this value, and the wrong request ID may be attached to
some responses. This is particularly apparent when requests arrive in parallel.
This change replaces process_request() and process_response() with an override
of __call__(). This allows the generated req_id to be used in the response
header without needing to save it as a class-level variable.
Reviewed: https:/ /review. openstack. org/79358 /git.openstack. org/cgit/ openstack/ oslo-incubator/ commit/ ?id=d7bd9dc37ac 3d6bc171cd2e290 c772633ad20a32
Committed: https:/
Submitter: Jenkins
Branch: master
commit d7bd9dc37ac3d6b c171cd2e290c772 633ad20a32
Author: Chris Buccella <email address hidden>
Date: Mon Mar 10 14:54:33 2014 +0000
Don't store the request ID value in middleware as class variable
The original version of the request_id middleware generates a request ID during request( ) and stores the value in a variable, so it can be attached as
process_
header in process_request(). This is pretty dangerous, since subsequent
requests will overwrite this value, and the wrong request ID may be attached to
some responses. This is particularly apparent when requests arrive in parallel.
This change replaces process_request() and process_response() with an override
of __call__(). This allows the generated req_id to be used in the response
header without needing to save it as a class-level variable.
Change-Id: I498859140ba113 412c9d95d09f0c4 c6b8650749c
Closes-bug: #1289696