)]}'
{"nova/context.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"46aa44ebe7f072376e6e98556e4b16c8689687d2","unresolved":false,"context_lines":[{"line_number":355,"context_line":"        from nova import rpc"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"        if context.db_connection or context.mq_connection:"},{"line_number":358,"context_line":"            LOG.warning(\u0027Attempting to set_target_cell on already-targeted \u0027"},{"line_number":359,"context_line":"                        \u0027context. New target cell will be %(cell)s\u0027,"},{"line_number":360,"context_line":"                        {\u0027cell\u0027: cell_mapping.identity})"},{"line_number":361,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_78b02d44","line":358,"updated":"2017-10-13 13:32:22.000000000","message":"Looks like this shows up in the n-api service:\n\nhttp://logstash.openstack.org/#dashboard/file/logstash.json?query\u003dmessage%3A%5C%22Attempting%20to%20set_target_cell%20on%20already-targeted%5C%22%20AND%20build_patchset%3A3\u0026from\u003d1d","commit_id":"43d2111f7f262ca8f0afe49683ed9642435f590e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c42a23811f9c7d35bed2b0dda6bc8cd355a33d36","unresolved":false,"context_lines":[{"line_number":355,"context_line":"        from nova import rpc"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"        if context.db_connection or context.mq_connection:"},{"line_number":358,"context_line":"            LOG.warning(\u0027Attempting to set_target_cell on already-targeted \u0027"},{"line_number":359,"context_line":"                        \u0027context. New target cell will be %(cell)s\u0027,"},{"line_number":360,"context_line":"                        {\u0027cell\u0027: cell_mapping.identity})"},{"line_number":361,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_38fbd547","line":358,"in_reply_to":"5f4e5783_78b02d44","updated":"2017-10-13 13:53:29.000000000","message":"I know we have places that do this.","commit_id":"43d2111f7f262ca8f0afe49683ed9642435f590e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"46aa44ebe7f072376e6e98556e4b16c8689687d2","unresolved":false,"context_lines":[{"line_number":360,"context_line":"                        {\u0027cell\u0027: cell_mapping.identity})"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        if hasattr(context, \u0027_enginefacade_context\u0027):"},{"line_number":363,"context_line":"            LOG.warning(\u0027Attempting to set_target_cell(%(cell)s) on context \u0027"},{"line_number":364,"context_line":"                        \u0027that has an existing transaction context.\u0027,"},{"line_number":365,"context_line":"                        {\u0027cell\u0027: cell_mapping.identity})"},{"line_number":366,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_78c70d98","line":363,"updated":"2017-10-13 13:32:22.000000000","message":"Seeing this in n-api quite a bit too:\n\nhttp://logstash.openstack.org/#dashboard/file/logstash.json?query\u003dmessage%3A%5C%22Attempting%20to%20set_target_cell%5C%22%20AND%20message%3A%5C%22that%20has%20an%20existing%20transaction%20context%5C%22%20AND%20build_patchset%3A3\u0026from\u003d1d","commit_id":"43d2111f7f262ca8f0afe49683ed9642435f590e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c42a23811f9c7d35bed2b0dda6bc8cd355a33d36","unresolved":false,"context_lines":[{"line_number":360,"context_line":"                        {\u0027cell\u0027: cell_mapping.identity})"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"        if hasattr(context, \u0027_enginefacade_context\u0027):"},{"line_number":363,"context_line":"            LOG.warning(\u0027Attempting to set_target_cell(%(cell)s) on context \u0027"},{"line_number":364,"context_line":"                        \u0027that has an existing transaction context.\u0027,"},{"line_number":365,"context_line":"                        {\u0027cell\u0027: cell_mapping.identity})"},{"line_number":366,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f4e5783_b89c650e","line":363,"in_reply_to":"5f4e5783_78c70d98","updated":"2017-10-13 13:53:29.000000000","message":"This would confirm the theory I think.","commit_id":"43d2111f7f262ca8f0afe49683ed9642435f590e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9146dda305018d9e2d3c71f75733416598944324","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    :param context: The RequestContext to add connection information"},{"line_number":391,"context_line":"    :param cell_mapping: An objects.CellMapping object or None"},{"line_number":392,"context_line":"    \"\"\""},{"line_number":393,"context_line":"    cctxt \u003d RequestContext.from_dict(context.to_dict())"},{"line_number":394,"context_line":"    set_target_cell(cctxt, cell_mapping)"},{"line_number":395,"context_line":"    yield cctxt"},{"line_number":396,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5f4e5783_fb9657f0","line":393,"updated":"2017-10-13 14:22:44.000000000","message":"We should probably put a comment above this. I had to look at the from_dict/to_dict to make sure that those don\u0027t include the db_connection and mq_connection values.\n\nI was a little bit worried about losing the perf bonus of the cache in get_or_set_cached_cell_and_set_connections but that wouldn\u0027t be an issue here as the cache is on the cell mapping and we want to target the context fresh each time using the db/mq connection values from the cell mapping.","commit_id":"51b5d1ee7c547c9ca34f2fcfc074da1fdecb470b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e6996e96c8c267e890d036cd507b85ad4284356","unresolved":false,"context_lines":[{"line_number":393,"context_line":"    # Create a sanitized copy of context by serializing and deserializing it"},{"line_number":394,"context_line":"    # (like we would do over RPC). This help ensure that we have a clean"},{"line_number":395,"context_line":"    # copy of the context with all the tracked attributes, but without any"},{"line_number":396,"context_line":"    # of the hidden/private thins we cache on a context. We do this to avoid"},{"line_number":397,"context_line":"    # unintentional sharing of cached thread-local data across threads."},{"line_number":398,"context_line":"    # Specifically, this won\u0027t include any oslo_db-set transaction context, or"},{"line_number":399,"context_line":"    # any existing cell targeting."}],"source_content_type":"text/x-python","patch_set":6,"id":"5f4e5783_afa1b548","line":396,"range":{"start_line":396,"start_character":28,"end_line":396,"end_character":33},"updated":"2017-10-13 16:15:19.000000000","message":"things","commit_id":"47bae3af70ffbc8848b36b62714253f7a1127749"}],"nova/tests/unit/test_context.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0e1d289f0b58a11a991a3e0c9cb87b76aad7fa9b","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        ctxt \u003d context.RequestContext(\u0027fake\u0027, \u0027fake\u0027)"},{"line_number":282,"context_line":"        ctxt.sentinel \u003d mock.sentinel.parent"},{"line_number":283,"context_line":"        with context.target_cell(ctxt, mock.sentinel.cm) as cctxt:"},{"line_number":284,"context_line":"            self.assertFalse(cctxt is ctxt)"},{"line_number":285,"context_line":"            self.assertFalse(hasattr(cctxt, \u0027sentinel\u0027))"},{"line_number":286,"context_line":"            cctxt.sentinel \u003d mock.sentinel.child"},{"line_number":287,"context_line":"        self.assertNotEqual(ctxt.sentinel, mock.sentinel.child)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_9bce43b2","line":284,"range":{"start_line":284,"start_character":17,"end_line":284,"end_character":28},"updated":"2017-10-13 14:09:58.000000000","message":"I think there is an assertIs you can use.","commit_id":"a9a19e5d671c5824306dd153565d3b05ba0199b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0e1d289f0b58a11a991a3e0c9cb87b76aad7fa9b","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        ctxt.sentinel \u003d mock.sentinel.parent"},{"line_number":283,"context_line":"        with context.target_cell(ctxt, mock.sentinel.cm) as cctxt:"},{"line_number":284,"context_line":"            self.assertFalse(cctxt is ctxt)"},{"line_number":285,"context_line":"            self.assertFalse(hasattr(cctxt, \u0027sentinel\u0027))"},{"line_number":286,"context_line":"            cctxt.sentinel \u003d mock.sentinel.child"},{"line_number":287,"context_line":"        self.assertNotEqual(ctxt.sentinel, mock.sentinel.child)"},{"line_number":288,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_9b5c03ee","line":285,"updated":"2017-10-13 14:09:58.000000000","message":"nit: provide a useful message if this fails since otherwise it\u0027s just going to say False is not True.","commit_id":"a9a19e5d671c5824306dd153565d3b05ba0199b9"}]}
