)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d923f33200ee1cc290e85f745f24366eacf23f3","unresolved":false,"context_lines":[{"line_number":19,"context_line":"worthless because it didn\u0027t show up *anywhere* in the logs on the Nova"},{"line_number":20,"context_line":"side."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"At some point to work around this problem a method"},{"line_number":23,"context_line":"get_placement_request_id was written to extract the"},{"line_number":24,"context_line":"X-Openstack-Request-Id from Placement\u0027s Response, and that request ID"},{"line_number":25,"context_line":"was then being prepended to log messages. Since that value corresponded"},{"line_number":26,"context_line":"to the Placement request\u0027s (not-global) request_id, which was being"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7faddb67_f4d71dbe","line":23,"range":{"start_line":22,"start_character":0,"end_line":23,"end_character":36},"updated":"2019-08-03 12:20:38.000000000","message":"Yeah this was me:\n\nIa8ee36ab0e79dfc2a178f2d354288b13d48bccdb\n\nIt\u0027s been a long time now but I think that was just a workaround and predates us passing the global request id header *to* placement.","commit_id":"12dfff7d8a7476af8577127f8d825b50abdbdfcc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d923f33200ee1cc290e85f745f24366eacf23f3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"logged properly on the Placement side, it provided a way to correlate"},{"line_number":28,"context_line":"the log entries as desired."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"What this commit does is to retrieve the global_id from the context in"},{"line_number":31,"context_line":"oslo.context\u0027s threadlocal storage and use that for"},{"line_number":32,"context_line":"X-Openstack-Request-Id instead. Since that is the request ID that Nova"},{"line_number":33,"context_line":"is logging, and it then becomes Placement\u0027s global_request_id and"},{"line_number":34,"context_line":"appears in the logs there, this allows proper correlation of the log"},{"line_number":35,"context_line":"entries as intended."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7faddb67_b448c5b2","line":32,"range":{"start_line":30,"start_character":0,"end_line":32,"end_character":31},"updated":"2019-08-03 12:20:38.000000000","message":"The thing I worry about this is if a periodic task is running on the compute while processing a user request that will hit placement and the task changes the thread-local context with some random admin context, is that possible? I\u0027m sure I\u0027ve seen the opposite case, where I\u0027m tracing a user request to create a server or migrate it or something and all of a sudden the request id is showing up in compute periodics like sync power states and heal instance info cache.","commit_id":"12dfff7d8a7476af8577127f8d825b50abdbdfcc"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d923f33200ee1cc290e85f745f24366eacf23f3","unresolved":false,"context_lines":[{"line_number":175,"context_line":"def _get_global_request_id(context):"},{"line_number":176,"context_line":"    oslo_thread_local_context \u003d oslo_ctx.get_current()"},{"line_number":177,"context_line":"    if oslo_thread_local_context is None:"},{"line_number":178,"context_line":"        LOG.error(\"No threadlocal context in oslo_context! This should never \""},{"line_number":179,"context_line":"                  \"happen!\")"},{"line_number":180,"context_line":"        # Using the context\u0027s global_id is better than nothing"},{"line_number":181,"context_line":"        return context.global_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_14e8b979","line":178,"updated":"2019-08-03 12:20:38.000000000","message":"Apparently this is happening:\n\nhttp://logstash.openstack.org/#dashboard/file/logstash.json?query\u003dmessage%3A%5C%22No%20threadlocal%20context%20in%20oslo_context!%20This%20should%20never%5C%22\u0026from\u003d7d\n\nSo we should figure out why and fix that, or soften this from an ERROR to debug or something.","commit_id":"12dfff7d8a7476af8577127f8d825b50abdbdfcc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d923f33200ee1cc290e85f745f24366eacf23f3","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    if oslo_thread_local_context is None:"},{"line_number":178,"context_line":"        LOG.error(\"No threadlocal context in oslo_context! This should never \""},{"line_number":179,"context_line":"                  \"happen!\")"},{"line_number":180,"context_line":"        # Using the context\u0027s global_id is better than nothing"},{"line_number":181,"context_line":"        return context.global_id"},{"line_number":182,"context_line":"    return oslo_thread_local_context.global_id"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_f4007d36","line":181,"range":{"start_line":180,"start_character":8,"end_line":181,"end_character":32},"updated":"2019-08-03 12:20:38.000000000","message":"I\u0027m not sure why this isn\u0027t OK, we do the same for other external services:\n\nhttps://github.com/openstack/nova/blob/600ecf3d9a5116d040cd18023ff270b91b06247d/nova/network/neutronv2/api.py#L175\n\nhttps://github.com/openstack/nova/blob/600ecf3d9a5116d040cd18023ff270b91b06247d/nova/volume/cinder.py#L277\n\nhttps://github.com/openstack/nova/blob/600ecf3d9a5116d040cd18023ff270b91b06247d/nova/image/glance.py#L79\n\nSo now talking to placement will be different and I worry about that thread local context being wrong. Mostly just because I don\u0027t trust it since it\u0027s global and other things can overwrite it out of band from the request being processed.","commit_id":"12dfff7d8a7476af8577127f8d825b50abdbdfcc"}]}
