)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"7b103608a499422e2935b81806f178669b3d7557","unresolved":true,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix error when set global_request_id"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When we call API of Openstack\u0027s core service such as nova, cinder,"},{"line_number":10,"context_line":"neutron and pass to request\u0027s header with \u0027X-OpenStack-Request-ID\u0027."},{"line_number":11,"context_line":"Request\u0027s response will return with header \u0027x-openstack-request-id\u0027"},{"line_number":12,"context_line":"not equal with ID that we was sent before."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Result: In service\u0027s logs and request\u0027s response have request ID not"},{"line_number":15,"context_line":"equal with ID that we expected"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f6d525a_052b5bf5","line":12,"range":{"start_line":9,"start_character":0,"end_line":12,"end_character":42},"updated":"2021-10-21 08:49:34.000000000","message":"By reading the unit tests, especially the one you modified, this behavior seems expected (the previous version). I\u0027m not against these changes, however, I think we need first to check if the different IDs is an expected behavior in design or if this simply an unforseen behavior.","commit_id":"181481a6ce88448d238f25eed0da46b4f71c81ba"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"1b494216eef38310acc5906c7de7b6f10d9b7171","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"2041e0ec_739107c4","updated":"2022-08-15 09:20:36.000000000","message":"I\u0027m against merging global request id to local request id because usage of local request id is beneficial in case a single api call causes multiple internal api calls.\n\nFor example when a user requests nova to attach a volume to an instance, nova send api calls to cinder twice, and having only a single global request id does no allow us to separate logs for these two request.","commit_id":"181481a6ce88448d238f25eed0da46b4f71c81ba"},{"author":{"_account_id":6926,"name":"Bogdan Dobrelya","email":"bdobreli@redhat.com","username":"bogdando"},"change_message_id":"a77cdfbad6b992f564c6db08e3699509f27d3c2f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"fcd20842_cecde993","updated":"2022-03-16 13:51:40.000000000","message":"this makes total sense (while having it random does not really)","commit_id":"181481a6ce88448d238f25eed0da46b4f71c81ba"}],"oslo_middleware/request_id.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3713e4e18744accb0f3eaea05c0c6b387e14f30b","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1cd4a3da_69cad806","line":70,"updated":"2022-03-18 00:34:20.000000000","message":"Personally, I don\u0027t think we should squash the global request ID into the local request ID. The solution I was thinking of is this:\n\n +++ b/oslo_middleware/request_id.py\n @@ -48,10 +48,11 @@ class RequestId(base.ConfigurableMiddleware):\n          # TODO(sdague): it would be nice to warn if we dropped a bogus\n          # request_id, but the infrastructure for doing that isn\u0027t yet \n          # setup at this stage.\n +        return gr_id\n  \n      @webob.dec.wsgify\n      def __call__(self, req):\n -        self.set_global_req_id(req)\n +        gr_id \u003d self.set_global_req_id(req)\n  \n          req_id \u003d context.generate_request_id()\n          req.environ[ENV_REQUEST_ID] \u003d req_id\n @@ -62,5 +63,5 @@ class RequestId(base.ConfigurableMiddleware):\n  \n          for header in return_headers:\n              if header not in response.headers:\n -                response.headers.add(header, req_id)\n +                response.headers.add(header, gr_id or req_id)\n          return response\n\nIt still fails the existing unit test but it would allow projects to use a local randomly generated request ID if they want while returning the global ID in the response if it was provided.","commit_id":"181481a6ce88448d238f25eed0da46b4f71c81ba"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"c1260fcaf02a40b726674abcf08485d7676c3c3b","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"5c84ebc1_ae2b38f2","line":70,"in_reply_to":"1cd4a3da_69cad806","updated":"2022-04-15 11:30:17.000000000","message":"@melwitt Your proposed solution WFM","commit_id":"181481a6ce88448d238f25eed0da46b4f71c81ba"}],"oslo_middleware/tests/test_request_id.py":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"7b103608a499422e2935b81806f178669b3d7557","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            res_req_id \u003d res_req_id.decode(\u0027utf-8\u0027)"},{"line_number":83,"context_line":"        # global-request-id in request environ is returned as response body"},{"line_number":84,"context_line":"        self.assertEqual(res.body.decode(\u0027utf-8\u0027), global_req)"},{"line_number":85,"context_line":"        self.assertNotEqual(res.body.decode(\u0027utf-8\u0027), res_req_id)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def test_global_request_id_drop(self):"},{"line_number":88,"context_line":"        \"\"\"Test that bad format ids are dropped."}],"source_content_type":"text/x-python","patch_set":1,"id":"1ceeb3a6_0d4527d6","side":"PARENT","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":65},"updated":"2021-10-21 08:49:34.000000000","message":"Different IDs seems expected. First, if it\u0027s possible, it could be worth to understand why.","commit_id":"c2e6b895a6d71eff19c65028347330df85041681"},{"author":{"_account_id":28691,"name":"Bo Tran","email":"ministry.96.nd@gmail.com","username":"ministry"},"change_message_id":"29ab772ca9224f1e1729a766e9470a743637cf37","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            res_req_id \u003d res_req_id.decode(\u0027utf-8\u0027)"},{"line_number":83,"context_line":"        # global-request-id in request environ is returned as response body"},{"line_number":84,"context_line":"        self.assertEqual(res.body.decode(\u0027utf-8\u0027), global_req)"},{"line_number":85,"context_line":"        self.assertNotEqual(res.body.decode(\u0027utf-8\u0027), res_req_id)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def test_global_request_id_drop(self):"},{"line_number":88,"context_line":"        \"\"\"Test that bad format ids are dropped."}],"source_content_type":"text/x-python","patch_set":1,"id":"8290e48d_8fc51cd2","side":"PARENT","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":65},"in_reply_to":"1ceeb3a6_0d4527d6","updated":"2021-12-13 01:53:37.000000000","message":"yep. but I don\u0027t know why different IDs seems expected when global ID was set. Can you help me?","commit_id":"c2e6b895a6d71eff19c65028347330df85041681"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e30740e4ff42dc448562bb30046a3e967a91a707","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            res_req_id \u003d res_req_id.decode(\u0027utf-8\u0027)"},{"line_number":83,"context_line":"        # global-request-id in request environ is returned as response body"},{"line_number":84,"context_line":"        self.assertEqual(res.body.decode(\u0027utf-8\u0027), global_req)"},{"line_number":85,"context_line":"        self.assertNotEqual(res.body.decode(\u0027utf-8\u0027), res_req_id)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def test_global_request_id_drop(self):"},{"line_number":88,"context_line":"        \"\"\"Test that bad format ids are dropped."}],"source_content_type":"text/x-python","patch_set":1,"id":"6588696f_a6610e8b","side":"PARENT","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":65},"in_reply_to":"8290e48d_8fc51cd2","updated":"2022-06-02 02:17:54.000000000","message":"I was going through patches on my dashboard and came across this again and looked to see if I could find the reasoning behind request ID !\u003d global ID. I think I found the reasoning in the spec for the feature [1]:\n\n\u003e We would accept an inbound X-OpenStack-Request-ID, and validate that it looked like req-$UUID before accepting it as the global_request_id.\n\u003e \n\u003e The returned X-OpenStack-Request-ID would be the existing request_id. This is like the parent process getting the child process id on a fork() call.\n\nIt was designed to only reply with the \"child\" request ID.\n\n[1] https://specs.openstack.org/openstack/oslo-specs/specs/pike/global-req-id.html#oslo-middleware-request-id","commit_id":"c2e6b895a6d71eff19c65028347330df85041681"}]}
