)]}'
{"id":"openstack%2Fplacement~673027","triplet_id":"openstack%2Fplacement~master~I5a80056dd88836a4e79a649fa02d36dc7e75eee4","project":"openstack/placement","branch":"master","topic":"request_log-middleware-last","hashtags":[],"change_id":"I5a80056dd88836a4e79a649fa02d36dc7e75eee4","subject":"Do request_log middleware next to last","status":"ABANDONED","created":"2019-07-26 17:53:39.000000000","updated":"2019-08-28 21:08:20.000000000","total_comment_count":2,"unresolved_comment_count":0,"has_review_started":true,"meta_rev_id":"4a68342471e4c84dcfaa7d07797d368d0e62b887","_number":673027,"virtual_id_number":673027,"owner":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"actions":{},"labels":{"Verified":{"recommended":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":1,"date":"2019-07-29 19:20:22.000000000","permitted_voting_range":{"min":-2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"date":"2019-08-09 06:09:56.000000000","_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","value":1,"default_value":0,"optional":true},"Code-Review":{"disliked":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"all":[{"value":0,"date":"2019-08-16 16:22:25.000000000","permitted_voting_range":{"min":-2,"max":2},"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"permitted_voting_range":{"min":-2,"max":2},"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"value":-1,"date":"2019-08-09 16:45:50.000000000","permitted_voting_range":{"min":-2,"max":2},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","value":-1,"default_value":0,"optional":true},"Workflow":{"rejected":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"all":[{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"permitted_voting_range":{"min":-1,"max":1},"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"value":-1,"date":"2019-08-09 16:45:50.000000000","permitted_voting_range":{"min":-1,"max":1},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"all":[{"value":0,"permitted_voting_range":{"min":0,"max":2},"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"permitted_voting_range":{"min":0,"max":1},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"permitted_voting_range":{"min":0,"max":2},"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},{"value":0,"permitted_voting_range":{"min":0,"max":2},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"}],"values":{" 0":"Default Priority","+1":"Contributor Review Promise","+2":"Core Review Promise"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2019-07-29 19:20:22.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2019-08-09 06:09:56.000000000","updated_by":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"reviewer":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"state":"REVIEWER"},{"updated":"2019-08-16 16:22:25.000000000","updated_by":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"reviewer":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"state":"REVIEWER"}],"messages":[{"id":"8cb843e09e62adcc340b023763fbd4a25947ca0f","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-26 17:53:39.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"94f201fd74653584fd41e966ace89b7e3b5ca502","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-26 19:23:34.000000000","message":"Patch Set 1: Verified-1\n\nBuild failed (check pipeline).  For information on how to proceed, see\nhttp://docs.openstack.org/infra/manual/developers.html#automated-testing\n\n\n- grenade-py3 http://logs.openstack.org/27/673027/1/check/grenade-py3/05edfb5/ : SUCCESS in 1h 10m 08s\n- tempest-integrated-placement http://logs.openstack.org/27/673027/1/check/tempest-integrated-placement/236eb2f/ : SUCCESS in 1h 23m 59s\n- openstack-tox-docs http://logs.openstack.org/27/673027/1/check/openstack-tox-docs/0d03298/html/ : SUCCESS in 3m 52s\n- openstack-tox-cover http://logs.openstack.org/27/673027/1/check/openstack-tox-cover/bcc80cd/ : FAILURE in 6m 25s\n- openstack-tox-lower-constraints http://logs.openstack.org/27/673027/1/check/openstack-tox-lower-constraints/ebfe494/ : FAILURE in 4m 26s\n- openstack-tox-pep8 http://logs.openstack.org/27/673027/1/check/openstack-tox-pep8/dc2ed13/ : SUCCESS in 4m 37s\n- openstack-tox-py27 http://logs.openstack.org/27/673027/1/check/openstack-tox-py27/d4414c5/ : FAILURE in 4m 41s\n- openstack-tox-py36 http://logs.openstack.org/27/673027/1/check/openstack-tox-py36/69df86f/ : FAILURE in 4m 37s\n- openstack-tox-py37 http://logs.openstack.org/27/673027/1/check/openstack-tox-py37/1204d57/ : FAILURE in 5m 18s\n- openstack-tox-functional http://logs.openstack.org/27/673027/1/check/openstack-tox-functional/6783134/ : SUCCESS in 7m 06s\n- openstack-tox-functional-py36 http://logs.openstack.org/27/673027/1/check/openstack-tox-functional-py36/60394d0/ : SUCCESS in 5m 54s\n- openstack-tox-functional-py37 http://logs.openstack.org/27/673027/1/check/openstack-tox-functional-py37/f0531ff/ : SUCCESS in 5m 39s\n- placement-nova-tox-functional-py37 http://logs.openstack.org/27/673027/1/check/placement-nova-tox-functional-py37/33674f8/ : SUCCESS in 12m 29s\n- placement-nested-perfload http://logs.openstack.org/27/673027/1/check/placement-nested-perfload/eb93cbf/ : SUCCESS in 17m 16s (non-voting)\n- placement-perfload http://logs.openstack.org/27/673027/1/check/placement-perfload/f80b19d/ : SUCCESS in 7m 54s (non-voting)","accounts_in_message":[],"_revision_number":1},{"id":"9e8ffbbaa285f0f1be78ccbebcd369c81ffe38ef","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-26 20:16:25.000000000","message":"Patch Set 1: Workflow-1\n\nNot sure what\u0027s going on with the unit test. This works in real life [1]. A little help?\n\n[1] http://logs.openstack.org/27/673027/1/check/grenade-py3/05edfb5/logs/screen-placement-api.txt.gz#_Jul_26_18_26_15_252477","accounts_in_message":[],"_revision_number":1},{"id":"de1e7c26397e57d6e61e0c931db422a3b561fe38","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-26 20:22:46.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1},{"id":"d324cbf3e8fd752c1c1d56cd09ed6ebfc0554236","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-29 12:39:15.000000000","message":"Patch Set 1:\n\nThe comment before the stack is bit out of date and probably needs to be cleaned up. The ordering is weird and you can\u0027t really discern what comes \"next\" from just that stack because each wsgi middleware has an inward (what it does in __call__) and outward (what it does in a replacement_start_response) side to its activity.\n\nThe oslo middleware req_id writes the request id into the environ on the inward side.\n\nThe request log middleware has two logs: a debug log that it writes when it starts the request and the \"real\" log it writes when it is done (the one with the size in it). It\u0027s the first one that\u0027s dying in the test which means that when it was in the location it had been in, something else was surreptitiously cooking the environ to set remote addr  and we just happened to be benefitting from it.\n\nIn the call to \u0027blank\u0027 you can pass a stub environ:\n\n    blank(path, environ\u003dNone, base_url\u003dNone, headers\u003dNone, POST\u003dNone, **kw)\n\nso that ought to get you past this but it would interesting to know which middleware was cooking things (because it probably shouldn\u0027t).\n\nYou\u0027re probably right about moving the logger, but all the above was to provide context to make sure that you\u0027re moving it in the way you think you\u0027re moving it.","accounts_in_message":[],"_revision_number":1},{"id":"e0a94c633ade9b506ff929880309c505b9b7fe85","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-29 15:59:56.000000000","message":"Uploaded patch set 2.","accounts_in_message":[],"_revision_number":2},{"id":"bb1dcb555170cae0b1270bdbb0e0c5519078daf4","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-29 16:12:53.000000000","message":"Patch Set 2: Code-Review+2\n\nI\u0027ll fup with a clarification on the NOTE near the chunk that\u0027s change here. There are some details that are wrong and the concept is not explained as well as it could be.","accounts_in_message":[],"_revision_number":2},{"id":"54a5137d3820306ce4ed414215d02d3c48c6fe99","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-29 16:22:33.000000000","message":"Patch Set 2: -Code-Review\n\nactually need to think about it more","accounts_in_message":[],"_revision_number":2},{"id":"dc0d35bb52e0618df907d0988b825ad9e282b260","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-29 16:35:03.000000000","message":"Uploaded patch set 3.","accounts_in_message":[],"_revision_number":3},{"id":"b1aa7930c96f9a675f655ca93d48ec7cc92c27e0","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-07-29 17:50:20.000000000","message":"Patch Set 3: Code-Review+1\n\nAgree with update.","accounts_in_message":[],"_revision_number":3},{"id":"5a3054b845c654fbc15bd5b69653c08ae1a561bf","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-07-29 19:20:22.000000000","message":"Patch Set 3: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 http://logs.openstack.org/27/673027/3/check/grenade-py3/e3c03ab/ : SUCCESS in 56m 56s\n- tempest-integrated-placement http://logs.openstack.org/27/673027/3/check/tempest-integrated-placement/d24261e/ : SUCCESS in 1h 21m 31s\n- openstack-tox-docs http://logs.openstack.org/27/673027/3/check/openstack-tox-docs/93dcac5/html/ : SUCCESS in 5m 08s\n- openstack-tox-cover http://logs.openstack.org/27/673027/3/check/openstack-tox-cover/a28a002/cover/ : SUCCESS in 5m 51s\n- openstack-tox-lower-constraints http://logs.openstack.org/27/673027/3/check/openstack-tox-lower-constraints/5771254/ : SUCCESS in 6m 06s\n- openstack-tox-pep8 http://logs.openstack.org/27/673027/3/check/openstack-tox-pep8/dfeb3df/ : SUCCESS in 5m 07s\n- openstack-tox-py27 http://logs.openstack.org/27/673027/3/check/openstack-tox-py27/6996f6c/ : SUCCESS in 5m 25s\n- openstack-tox-py36 http://logs.openstack.org/27/673027/3/check/openstack-tox-py36/085fe34/ : SUCCESS in 5m 25s\n- openstack-tox-py37 http://logs.openstack.org/27/673027/3/check/openstack-tox-py37/8d89012/ : SUCCESS in 7m 02s\n- openstack-tox-functional http://logs.openstack.org/27/673027/3/check/openstack-tox-functional/5822f63/ : SUCCESS in 4m 49s\n- openstack-tox-functional-py36 http://logs.openstack.org/27/673027/3/check/openstack-tox-functional-py36/3fcf5a2/ : SUCCESS in 5m 21s\n- openstack-tox-functional-py37 http://logs.openstack.org/27/673027/3/check/openstack-tox-functional-py37/7bab619/ : SUCCESS in 5m 49s\n- placement-nova-tox-functional-py37 http://logs.openstack.org/27/673027/3/check/placement-nova-tox-functional-py37/045dba6/ : SUCCESS in 11m 22s\n- placement-nested-perfload http://logs.openstack.org/27/673027/3/check/placement-nested-perfload/054e2e0/ : SUCCESS in 20m 08s (non-voting)\n- placement-perfload http://logs.openstack.org/27/673027/3/check/placement-perfload/2f4c2ad/ : SUCCESS in 8m 11s (non-voting)","accounts_in_message":[],"_revision_number":3},{"id":"d1eff49c6bf2f43294031f47a1f69d6e86a77f7c","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-07-31 09:28:37.000000000","message":"Patch Set 3: Code-Review+1\n\ni\u0027m happy with this too","accounts_in_message":[],"_revision_number":3},{"id":"0539729ef24e48dccf7a73eb230cf130931e0c31","author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"date":"2019-08-09 06:09:56.000000000","message":"Patch Set 3:\n\n(1 comment)","accounts_in_message":[],"_revision_number":3},{"id":"39a0c144e380c3214c737091ddf156166b16b68a","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-09 16:45:50.000000000","message":"Patch Set 3: Code-Review-1 Workflow-1\n\nYou\u0027re absolutely right, Tetsuro. In all the confusion in this patch I lost sight of the actual problem that started it off. And at this point the commit message is plain wrong in claiming that the headers are now emitted when logging.\n\nHere\u0027s the recreate:\n\n- Apply https://review.opendev.org/#/c/672984/\n- Make a gabbi test fail, e.g.\n\n --- a/placement/tests/functional/gabbits/allocation-candidates.yaml\n +++ b/placement/tests/functional/gabbits/allocation-candidates.yaml\n @@ -33,7 +33,7 @@ tests:\n  \n  - name: get allocation candidates no resources\n    GET: /allocation_candidates\n -  status: 400\n +  status: 401\n    response_strings:\n        - \"\u0027resources\u0027 is a required property\"\n \n- Run the gabbi test, e.g.\n\n tox -e functional-py36 -- get_allocation_candidates_no_resources\n\n- Before and after this patch (at PS3) the \u0027x-openstack-request-id\u0027 header is absent.\n- Reversing the order of req_id_middleware and request_log makes it appear.\n\nThe catch here is that we want to log as late as possible on *both* the inbound and outbound paths, because we want the logs to show things in a state as close as possible to what the application receives, and also as close as possible to what\u0027s sent back out over the wire.\n\nDo we need to split request_log into two, an \u0027inbound\u0027 and \u0027outbound\u0027, so we can position each where it needs to go?","accounts_in_message":[],"_revision_number":3},{"id":"5f09911d2250782cea918fbe1a2b8799bad0f779","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-09 16:54:41.000000000","message":"Patch Set 3: -Code-Review\n\nWhat about: subclass the request id middleware and incorporate the requestlog functionality into it, leaving behind one piece of middleware, called \u0027request\u0027?\n\nthat piece would be the outermost middleware meaning that on the inbound side it would get the request-id as early as possible and write a \"we\u0027re starting a new request\" DEBUG line. And on the outbound it would do the \"we\u0027ve finished a request\" INFO line.","accounts_in_message":[],"_revision_number":3},{"id":"89573baba46d91e723a053aa4d964995b629285c","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-09 16:58:28.000000000","message":"Patch Set 3:\n\nIt sounds like an interesting idea, but my head is exploding trying to grok the implications of where and how to call what via super().\n\nI\u0027ll look into it later when my head isn\u0027t so fuzzy.","accounts_in_message":[],"_revision_number":3},{"id":"cfc26f07ef5ed58da1ce05d7bd2cc03833b875ba","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-16 16:22:25.000000000","message":"Patch Set 3:\n\n\u003e It sounds like an interesting idea, but my head is exploding trying\n \u003e to grok the implications of where and how to call what via super().\n \u003e \n \u003e I\u0027ll look into it later when my head isn\u0027t so fuzzy.\n\nI gave it a shot at https://review.opendev.org/#/c/676982/\n\nNot quite as tidy as I was hoping, but we may be able to rescue it. Feel free to mess with it while I\u0027m away.","accounts_in_message":[],"_revision_number":3},{"id":"b159ea1d6951e63907ee4e9c944c9ed3c0676b21","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-28 21:08:20.000000000","message":"Abandoned\n\nin favor of https://review.opendev.org/#/c/676982/","accounts_in_message":[],"_revision_number":3}],"current_revision_number":3,"current_revision":"71071a79881959d80dff0aa3320a1471b1bd4233","revisions":{"ce5690afe48d861d462cefd142cb77619797a953":{"kind":"REWORK","_number":1,"created":"2019-07-26 17:53:39.000000000","uploader":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"ref":"refs/changes/27/673027/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/27/673027/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/27/673027/1"}}},"commit":{"parents":[{"commit":"2f56f379a568d427ac9057086386074a7801b00c","subject":"Merge \"Use integrated-gate-placement zuul template\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/2f56f379a568d427ac9057086386074a7801b00c"}]}],"author":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-07-26 17:44:27.000000000","tz":-300},"committer":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-07-26 17:44:27.000000000","tz":-300},"subject":"Do request_log middleware last","message":"Do request_log middleware last\n\nWhile trying to track down a global_request_id problem, I added some\ndebug logging into RequestLog [1] but the x-openstack-request-id was not\nemitted:\n\nheaders: [(\u0027Content-Length\u0027, \u0027162\u0027),\n         (\u0027Content-Type\u0027, \u0027application/json\u0027),\n         (\u0027openstack-api-version\u0027, \u0027placement 1.8\u0027),\n         (\u0027vary\u0027, \u0027openstack-api-version\u0027)]\n\nIt turns out we were hitting the request_log middleware before the\nreq_id_middleware.\n\nEven though we don\u0027t (currently) log headers under normal circumstances,\nthe logger should have a crack at the request in a form as close as\npossible to what\u0027s going to be sent across the wire. So this commit\nmoves request_log last in the chain.\n\nAfter this change, the above becomes:\n\nheaders: [(\u0027Content-Length\u0027, \u0027162\u0027),\n         (\u0027Content-Type\u0027, \u0027application/json\u0027),\n         (\u0027openstack-api-version\u0027, \u0027placement 1.8\u0027),\n         (\u0027vary\u0027, \u0027openstack-api-version\u0027),\n         (\u0027x-openstack-request-id\u0027, \u0027req-99385d48-0860-48ff-a4a4-a2423153f0f2\u0027)]\n\n[1] https://review.opendev.org/#/c/672984/\n\nChange-Id: I5a80056dd88836a4e79a649fa02d36dc7e75eee4\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/ce5690afe48d861d462cefd142cb77619797a953"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/ce5690afe48d861d462cefd142cb77619797a953"}]},"branch":"refs/heads/master"},"1965446d4e890f3add2240253a71280a7e28a4f3":{"kind":"REWORK","_number":2,"created":"2019-07-29 15:59:56.000000000","uploader":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"ref":"refs/changes/27/673027/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/27/673027/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/27/673027/2"}}},"commit":{"parents":[{"commit":"2f56f379a568d427ac9057086386074a7801b00c","subject":"Merge \"Use integrated-gate-placement zuul template\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/2f56f379a568d427ac9057086386074a7801b00c"}]}],"author":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-07-26 17:44:27.000000000","tz":-300},"committer":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-07-29 15:58:27.000000000","tz":-300},"subject":"Do request_log middleware last","message":"Do request_log middleware last\n\nWhile trying to track down a global_request_id problem, I added some\ndebug logging into RequestLog [1] but the x-openstack-request-id was not\nemitted:\n\nheaders: [(\u0027Content-Length\u0027, \u0027162\u0027),\n         (\u0027Content-Type\u0027, \u0027application/json\u0027),\n         (\u0027openstack-api-version\u0027, \u0027placement 1.8\u0027),\n         (\u0027vary\u0027, \u0027openstack-api-version\u0027)]\n\nIt turns out we were hitting the request_log middleware before the\nreq_id_middleware.\n\nEven though we don\u0027t (currently) log headers under normal circumstances,\nthe logger should have a crack at the request in a form as close as\npossible to what\u0027s going to be sent across the wire. So this commit\nmoves request_log last in the chain.\n\nAfter this change, the above becomes:\n\nheaders: [(\u0027Content-Length\u0027, \u0027162\u0027),\n         (\u0027Content-Type\u0027, \u0027application/json\u0027),\n         (\u0027openstack-api-version\u0027, \u0027placement 1.8\u0027),\n         (\u0027vary\u0027, \u0027openstack-api-version\u0027),\n         (\u0027x-openstack-request-id\u0027, \u0027req-99385d48-0860-48ff-a4a4-a2423153f0f2\u0027)]\n\nNote that reordering broke an unrelated test that was expecting\nenviron[\u0027REMOTE_ADDR\u0027], which isn\u0027t set in the \"blank\" Request being\nused, so this is addressed as well.\n\n[1] https://review.opendev.org/#/c/672984/\n\nChange-Id: I5a80056dd88836a4e79a649fa02d36dc7e75eee4\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/1965446d4e890f3add2240253a71280a7e28a4f3"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/1965446d4e890f3add2240253a71280a7e28a4f3"}]},"branch":"refs/heads/master"},"71071a79881959d80dff0aa3320a1471b1bd4233":{"kind":"REWORK","_number":3,"created":"2019-07-29 16:35:03.000000000","uploader":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"ref":"refs/changes/27/673027/3","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/27/673027/3","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/27/673027/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/27/673027/3"}}},"commit":{"parents":[{"commit":"2f56f379a568d427ac9057086386074a7801b00c","subject":"Merge \"Use integrated-gate-placement zuul template\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/2f56f379a568d427ac9057086386074a7801b00c"}]}],"author":{"name":"Eric Fried","email":"openstack@fried.cc","date":"2019-07-26 17:44:27.000000000","tz":-300},"committer":{"name":"Chris Dent","email":"cdent@anticdent.org","date":"2019-07-29 16:34:49.000000000","tz":60},"subject":"Do request_log middleware next to last","message":"Do request_log middleware next to last\n\nWhile trying to track down a global_request_id problem, I added some\ndebug logging into RequestLog [1] but the x-openstack-request-id was not\nemitted:\n\nheaders: [(\u0027Content-Length\u0027, \u0027162\u0027),\n         (\u0027Content-Type\u0027, \u0027application/json\u0027),\n         (\u0027openstack-api-version\u0027, \u0027placement 1.8\u0027),\n         (\u0027vary\u0027, \u0027openstack-api-version\u0027)]\n\nIt turns out the request_log middleware and req_id_middleware were not\ninteracting well. We need to establish the request id, from incoming\nheaders, first, then as soon as we can, start logging. Then we want the\nfinal log to be as near the end of the request as possible.\n\nEven though we don\u0027t (currently) log headers under normal circumstances,\nthe logger should have a crack at the request in a form as close as\npossible to what\u0027s going to be sent across the wire. So this commit\nmoves request_log to next to last in the chain.\n\nAfter this change, the above becomes:\n\nheaders: [(\u0027Content-Length\u0027, \u0027162\u0027),\n         (\u0027Content-Type\u0027, \u0027application/json\u0027),\n         (\u0027openstack-api-version\u0027, \u0027placement 1.8\u0027),\n         (\u0027vary\u0027, \u0027openstack-api-version\u0027),\n         (\u0027x-openstack-request-id\u0027, \u0027req-99385d48-0860-48ff-a4a4-a2423153f0f2\u0027)]\n\nNote that reordering broke an unrelated test that was expecting\nenviron[\u0027REMOTE_ADDR\u0027], which isn\u0027t set in the \"blank\" Request being\nused, so this is addressed as well.\n\n[1] https://review.opendev.org/#/c/672984/\n\nChange-Id: I5a80056dd88836a4e79a649fa02d36dc7e75eee4\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/71071a79881959d80dff0aa3320a1471b1bd4233"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/71071a79881959d80dff0aa3320a1471b1bd4233"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
