)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"7caae7f272215a1cc25a45d21bf4592aeb9943bb","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Change-Id: Ia1ff6f7559ab77913ddb9c3b134420a401b8eb43"},{"line_number":35,"context_line":"Co-Authored-By: Lajos Katona \u003clajos.katona@ericsson.com\u003e"},{"line_number":36,"context_line":"Depends-On: https://review.openstack.org/577220"},{"line_number":37,"context_line":"Partial-Bug: #1578989"},{"line_number":38,"context_line":"See-Also: https://review.openstack.org/502306 (nova spec)"},{"line_number":39,"context_line":"See-Also: https://review.openstack.org/508149 (neutron spec)"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3f79a3b5_4a70aa08","line":36,"range":{"start_line":36,"start_character":12,"end_line":36,"end_character":47},"updated":"2018-08-15 15:22:39.000000000","message":"nit: I think you depend on the uuid5 namespace patch: https://review.openstack.org/586567","commit_id":"704cdf8a3191f411752720f4b224a4a48bf8ebe2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"Change-Id: Ia1ff6f7559ab77913ddb9c3b134420a401b8eb43"},{"line_number":35,"context_line":"Co-Authored-By: Lajos Katona \u003clajos.katona@ericsson.com\u003e"},{"line_number":36,"context_line":"Depends-On: https://review.openstack.org/577220"},{"line_number":37,"context_line":"Partial-Bug: #1578989"},{"line_number":38,"context_line":"See-Also: https://review.openstack.org/502306 (nova spec)"},{"line_number":39,"context_line":"See-Also: https://review.openstack.org/508149 (neutron spec)"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"3f79a3b5_0ea9468e","line":36,"range":{"start_line":36,"start_character":12,"end_line":36,"end_character":47},"in_reply_to":"3f79a3b5_4a70aa08","updated":"2018-08-30 15:48:35.000000000","message":"Done","commit_id":"704cdf8a3191f411752720f4b224a4a48bf8ebe2"}],"neutron/services/placement_report/plugin.py":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"cc44095daea2577bef81ebb26b022c3f0225931d","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        #     agent config was (re-)read and changed in the relevant parts"},{"line_number":161,"context_line":"        if (status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":162,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":163,"context_line":"                previous !\u003d current):"},{"line_number":164,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":165,"context_line":"            self._sync_placement_state(agent)"},{"line_number":166,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_95413b3a","line":163,"range":{"start_line":163,"start_character":16,"end_line":163,"end_character":35},"updated":"2018-07-30 11:37:28.000000000","message":"This won\u0027t work in an AFTER_UPDATE callback.","commit_id":"f2edd93059c59ed068ca9ef185fc42356248f6e4"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"b5b31c9281201037a0f16bf3319cca1eddf09982","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        #     agent config was (re-)read and changed in the relevant parts"},{"line_number":161,"context_line":"        if (status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":162,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":163,"context_line":"                previous !\u003d current):"},{"line_number":164,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":165,"context_line":"            self._sync_placement_state(agent)"},{"line_number":166,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_2245199c","line":163,"range":{"start_line":163,"start_character":16,"end_line":163,"end_character":35},"in_reply_to":"5f7c97a3_95413b3a","updated":"2018-08-03 11:57:22.000000000","message":"Done","commit_id":"f2edd93059c59ed068ca9ef185fc42356248f6e4"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"8090c7f4ca52c6d6fe332ed8579e89edbb0713f4","unresolved":false,"context_lines":[{"line_number":35,"context_line":"@registry.has_registry_receivers"},{"line_number":36,"context_line":"class PlacementReportPlugin(service_base.ServicePluginBase):"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    supported_extension_aliases \u003d []"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    @classmethod"},{"line_number":41,"context_line":"    def get_plugin_type(cls):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_c8ee8db3","line":38,"updated":"2018-08-08 22:49:14.000000000","message":"I would ask for putting \u0027__filter_validation_support \u003d True\u0027 for this plugin.\n\nIt is possibly not straightforward but a service plugin without claiming support for filter validation would disable this feature for all other plugins (see https://review.openstack.org/#/c/574907/20/neutron/common/utils.py), so I ask for claiming support for it although this plugin doesn\u0027t have any filter.","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":35,"context_line":"@registry.has_registry_receivers"},{"line_number":36,"context_line":"class PlacementReportPlugin(service_base.ServicePluginBase):"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    supported_extension_aliases \u003d []"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    @classmethod"},{"line_number":41,"context_line":"    def get_plugin_type(cls):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_b4ed51b8","line":38,"in_reply_to":"3f79a3b5_c8ee8db3","updated":"2018-08-30 15:48:35.000000000","message":"Sure, I didn\u0027t know that. If you don\u0027t mind I lifted your explanation for a comment here.","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"8090c7f4ca52c6d6fe332ed8579e89edbb0713f4","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            try:"},{"line_number":58,"context_line":"                LOG.debug(\u0027placement client: {}\u0027.format(deferred))"},{"line_number":59,"context_line":"                deferred.execute()"},{"line_number":60,"context_line":"            except place_exc.PlacementEndpointNotFound:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Placement API was not found\u0027)"},{"line_number":62,"context_line":"            # TODO(bence romsics): We could handle transient errors by"},{"line_number":63,"context_line":"            # adding a retry TTL to the events and pushing a failed action"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_29c14081","line":60,"range":{"start_line":60,"start_character":29,"end_line":60,"end_character":54},"updated":"2018-08-08 22:49:14.000000000","message":"If there is no placement endpoint, this will fail periodically. Perhaps it can be optimized to not execute if there is no placement endpoint detected at the last execute? However, I am not sure about this. Just want to bring this point up.","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            try:"},{"line_number":58,"context_line":"                LOG.debug(\u0027placement client: {}\u0027.format(deferred))"},{"line_number":59,"context_line":"                deferred.execute()"},{"line_number":60,"context_line":"            except place_exc.PlacementEndpointNotFound:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Placement API was not found\u0027)"},{"line_number":62,"context_line":"            # TODO(bence romsics): We could handle transient errors by"},{"line_number":63,"context_line":"            # adding a retry TTL to the events and pushing a failed action"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_26d6e229","line":60,"range":{"start_line":60,"start_character":29,"end_line":60,"end_character":54},"in_reply_to":"3f79a3b5_29c14081","updated":"2018-08-30 15:48:35.000000000","message":"After reading some code I realized this exception is swallowed by the new neutron-lib version of the placement client, so we\u0027ll never catch it here. It was only raised by the old neutron version of the placement client.\n\nHowever I found this bug and bugfix that may affect us here too:\nI02ac615dc26a4a0d1fd28a638f622777e41d14e4\n\nI\u0027ll need to test if we have the same problem here or not.\n\nAlso it seems I need to make a few small fixes in the placement client lib.","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"8090c7f4ca52c6d6fe332ed8579e89edbb0713f4","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            # not be affected by a failed event. Shall we mark an agent somehow"},{"line_number":68,"context_line":"            # defunct if its placement operations failed non-transiently?"},{"line_number":69,"context_line":"            except Exception:"},{"line_number":70,"context_line":"                LOG.exception(\u0027FIXME collect exception types to suppress\u0027)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    # FIXME(bence romsics): We do not want to know here about which agent"},{"line_number":73,"context_line":"    # uses what format for its mappings. Instead we should extend the mech"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_0b3c7cc6","line":70,"range":{"start_line":70,"start_character":20,"end_line":70,"end_character":29},"updated":"2018-08-08 22:49:14.000000000","message":"This is what I got: http://paste.openstack.org/show/727672/ . I saw the log contains a generic bad request error message but it is not the \u0027real\u0027 error message.\n\nI think we\u0027d better to log the \u0027real\u0027 error message in here. To get the \u0027real\u0027 error message, we need to catch the BadRequest exception and retrieve the \u0027response\u0027 field of the exception instance.","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"b5fad9c09db971774b4643ebf2d77a5f80ec47e6","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            # not be affected by a failed event. Shall we mark an agent somehow"},{"line_number":68,"context_line":"            # defunct if its placement operations failed non-transiently?"},{"line_number":69,"context_line":"            except Exception:"},{"line_number":70,"context_line":"                LOG.exception(\u0027FIXME collect exception types to suppress\u0027)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    # FIXME(bence romsics): We do not want to know here about which agent"},{"line_number":73,"context_line":"    # uses what format for its mappings. Instead we should extend the mech"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_6bcaa247","line":70,"range":{"start_line":70,"start_character":20,"end_line":70,"end_character":29},"in_reply_to":"3f79a3b5_063de6db","updated":"2019-01-15 15:01:36.000000000","message":"Please see: https://review.openstack.org/619302","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            # not be affected by a failed event. Shall we mark an agent somehow"},{"line_number":68,"context_line":"            # defunct if its placement operations failed non-transiently?"},{"line_number":69,"context_line":"            except Exception:"},{"line_number":70,"context_line":"                LOG.exception(\u0027FIXME collect exception types to suppress\u0027)"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    # FIXME(bence romsics): We do not want to know here about which agent"},{"line_number":73,"context_line":"    # uses what format for its mappings. Instead we should extend the mech"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_063de6db","line":70,"range":{"start_line":70,"start_character":20,"end_line":70,"end_character":29},"in_reply_to":"3f79a3b5_0b3c7cc6","updated":"2018-08-30 15:48:35.000000000","message":"Done","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"8090c7f4ca52c6d6fe332ed8579e89edbb0713f4","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":131,"context_line":"            return"},{"line_number":132,"context_line":"        if \u0027rp_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":133,"context_line":"            return"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # sync the state known by us to placement"},{"line_number":136,"context_line":"        if ("}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_09224453","line":133,"range":{"start_line":133,"start_character":12,"end_line":133,"end_character":18},"updated":"2018-08-08 22:49:14.000000000","message":"If it falls into here, it implies that this service plugin is enabled in neutron server but the neutron agent is not configured properly to report the RPs? If yes, better to log a warning message in here.","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":131,"context_line":"            return"},{"line_number":132,"context_line":"        if \u0027rp_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":133,"context_line":"            return"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # sync the state known by us to placement"},{"line_number":136,"context_line":"        if ("}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_e13f7484","line":133,"range":{"start_line":133,"start_character":12,"end_line":133,"end_character":18},"in_reply_to":"3f79a3b5_09224453","updated":"2018-08-30 15:48:35.000000000","message":"Done","commit_id":"c4746aea877b3105a4f0ebfb8438fefb11d0d6a5"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"7caae7f272215a1cc25a45d21bf4592aeb9943bb","unresolved":false,"context_lines":[{"line_number":156,"context_line":"    @property"},{"line_number":157,"context_line":"    def supported_agent_types(self):"},{"line_number":158,"context_line":"        if not self._supported_agent_types:"},{"line_number":159,"context_line":"            # NOTE(bence romsics): At the moment we treat the presence of the"},{"line_number":160,"context_line":"            # RP uuid namespace a proxy for supporting placement reports from"},{"line_number":161,"context_line":"            # the driver\u0027s agent type. But we could introduce a property/logic"},{"line_number":162,"context_line":"            # explicitly describing the agent types supporting placement"},{"line_number":163,"context_line":"            # reports any time if this proved to be insufficient."},{"line_number":164,"context_line":"            self._supported_agent_types \u003d ["},{"line_number":165,"context_line":"                driver.obj.agent_type for driver"},{"line_number":166,"context_line":"                in self._mechanism_drivers"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_5f3e23b8","line":163,"range":{"start_line":159,"start_character":12,"end_line":163,"end_character":65},"updated":"2018-08-15 15:22:39.000000000","message":"Just a note without having much knowledge: agent has as well an OVO, which has a version (now 1.0) I suppose you can introduce the uuid5 namespace as a new version....\n\nI am not sure if a change in the mech_driver should be mirrored to the agent OVO....","commit_id":"704cdf8a3191f411752720f4b224a4a48bf8ebe2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":156,"context_line":"    @property"},{"line_number":157,"context_line":"    def supported_agent_types(self):"},{"line_number":158,"context_line":"        if not self._supported_agent_types:"},{"line_number":159,"context_line":"            # NOTE(bence romsics): At the moment we treat the presence of the"},{"line_number":160,"context_line":"            # RP uuid namespace a proxy for supporting placement reports from"},{"line_number":161,"context_line":"            # the driver\u0027s agent type. But we could introduce a property/logic"},{"line_number":162,"context_line":"            # explicitly describing the agent types supporting placement"},{"line_number":163,"context_line":"            # reports any time if this proved to be insufficient."},{"line_number":164,"context_line":"            self._supported_agent_types \u003d ["},{"line_number":165,"context_line":"                driver.obj.agent_type for driver"},{"line_number":166,"context_line":"                in self._mechanism_drivers"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_6aa98a22","line":163,"range":{"start_line":159,"start_character":12,"end_line":163,"end_character":65},"in_reply_to":"3f79a3b5_5f3e23b8","updated":"2018-08-30 15:48:35.000000000","message":"Unless I\u0027m misunderstanding something OVO is not for this.\n\nWe need to express if an agent type supports the feature, not if an agent instance supports it. Some agents of the same type reporting and others not is a situation that can only happen in the middle of an upgrade. But even then we would lose a tiny bit of optimization - not having such an early exit in handle_placement_config.","commit_id":"704cdf8a3191f411752720f4b224a4a48bf8ebe2"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"7caae7f272215a1cc25a45d21bf4592aeb9943bb","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"class ResourceProvider(object):"},{"line_number":182,"context_line":"    \u0027\u0027\u0027Query Resource Providers efficiently (ie. cached)."},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    If we were to call \u0027resource provider show\u0027 every time we need a"},{"line_number":185,"context_line":"    compute host RP UUID that would be seriously inefficient. For example"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_cad27ad1","line":182,"range":{"start_line":182,"start_character":4,"end_line":182,"end_character":7},"updated":"2018-08-15 15:22:39.000000000","message":"nit: Triple double-quoted strings should be used for docstrings like:\n\"\"\"blah\"\"\"\n\nsee: https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings","commit_id":"704cdf8a3191f411752720f4b224a4a48bf8ebe2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"class ResourceProvider(object):"},{"line_number":182,"context_line":"    \u0027\u0027\u0027Query Resource Providers efficiently (ie. cached)."},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    If we were to call \u0027resource provider show\u0027 every time we need a"},{"line_number":185,"context_line":"    compute host RP UUID that would be seriously inefficient. For example"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_cea4aea8","line":182,"range":{"start_line":182,"start_character":4,"end_line":182,"end_character":7},"in_reply_to":"3f79a3b5_cad27ad1","updated":"2018-08-30 15:48:35.000000000","message":"Done","commit_id":"704cdf8a3191f411752720f4b224a4a48bf8ebe2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"88f7bae97094e7891ef94e71a55ea6fcff9d67d4","unresolved":false,"context_lines":[{"line_number":226,"context_line":"    \"\"\"Query Resource Providers efficiently (ie. cached)."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    If we were to call \u0027resource provider show\u0027 every time we need a"},{"line_number":229,"context_line":"    compute host RP UUID that would be seriously inefficient. For example"},{"line_number":230,"context_line":"    at neutron-server startup with hundreds of agents we\u0027d make hundreds"},{"line_number":231,"context_line":"    of turnarounds to placement. To amortize that we maintain a cache."},{"line_number":232,"context_line":"    First we populate it by \u0027resource provider list\u0027."},{"line_number":233,"context_line":"    Then we maintain it by \u0027resource provider show\u0027."},{"line_number":234,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_1b9946cf","line":231,"range":{"start_line":229,"start_character":62,"end_line":231,"end_character":32},"updated":"2018-08-30 15:48:35.000000000","message":"This is no longer true.","commit_id":"613ad21e5d3f9187be05fbce13823102ef415379"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"bb6d580e4d2ee8a9d620adf19917c17205698cac","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    # driver API and ask the mech drivers to do this work for us."},{"line_number":101,"context_line":"    def _get_standard_device_mappings(self, agent):"},{"line_number":102,"context_line":"        agent_type \u003d agent[\u0027agent_type\u0027]"},{"line_number":103,"context_line":"        if agent_type \u003d\u003d \u0027NIC Switch agent\u0027:"},{"line_number":104,"context_line":"            device_mappings \u003d agent[\u0027configurations\u0027][\u0027device_mappings\u0027]"},{"line_number":105,"context_line":"        elif agent_type \u003d\u003d \u0027Open vSwitch agent\u0027:"},{"line_number":106,"context_line":"            device_mappings \u003d {"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_20838ecd","line":103,"range":{"start_line":103,"start_character":25,"end_line":103,"end_character":44},"updated":"2018-09-27 10:02:37.000000000","message":"You can use neutron-lib/constants AGENT_TYPE_***","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"967ef575424486ca4fb86e752b4f96d54589a89f","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    # driver API and ask the mech drivers to do this work for us."},{"line_number":101,"context_line":"    def _get_standard_device_mappings(self, agent):"},{"line_number":102,"context_line":"        agent_type \u003d agent[\u0027agent_type\u0027]"},{"line_number":103,"context_line":"        if agent_type \u003d\u003d \u0027NIC Switch agent\u0027:"},{"line_number":104,"context_line":"            device_mappings \u003d agent[\u0027configurations\u0027][\u0027device_mappings\u0027]"},{"line_number":105,"context_line":"        elif agent_type \u003d\u003d \u0027Open vSwitch agent\u0027:"},{"line_number":106,"context_line":"            device_mappings \u003d {"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_150c8aea","line":103,"range":{"start_line":103,"start_character":25,"end_line":103,"end_character":44},"in_reply_to":"3f79a3b5_20838ecd","updated":"2018-09-27 13:31:47.000000000","message":"I\u0027ll get rid of this function completely soon. Please see the FIXME comment above.","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"bb6d580e4d2ee8a9d620adf19917c17205698cac","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        agent_type \u003d agent[\u0027agent_type\u0027]"},{"line_number":103,"context_line":"        if agent_type \u003d\u003d \u0027NIC Switch agent\u0027:"},{"line_number":104,"context_line":"            device_mappings \u003d agent[\u0027configurations\u0027][\u0027device_mappings\u0027]"},{"line_number":105,"context_line":"        elif agent_type \u003d\u003d \u0027Open vSwitch agent\u0027:"},{"line_number":106,"context_line":"            device_mappings \u003d {"},{"line_number":107,"context_line":"                k: [v] for k, v in agent["},{"line_number":108,"context_line":"                    \u0027configurations\u0027][\u0027bridge_mappings\u0027].items()}"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_a06ebe29","line":105,"range":{"start_line":105,"start_character":27,"end_line":105,"end_character":48},"updated":"2018-09-27 10:02:37.000000000","message":"ditto","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"967ef575424486ca4fb86e752b4f96d54589a89f","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        agent_type \u003d agent[\u0027agent_type\u0027]"},{"line_number":103,"context_line":"        if agent_type \u003d\u003d \u0027NIC Switch agent\u0027:"},{"line_number":104,"context_line":"            device_mappings \u003d agent[\u0027configurations\u0027][\u0027device_mappings\u0027]"},{"line_number":105,"context_line":"        elif agent_type \u003d\u003d \u0027Open vSwitch agent\u0027:"},{"line_number":106,"context_line":"            device_mappings \u003d {"},{"line_number":107,"context_line":"                k: [v] for k, v in agent["},{"line_number":108,"context_line":"                    \u0027configurations\u0027][\u0027bridge_mappings\u0027].items()}"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_5503e276","line":105,"range":{"start_line":105,"start_character":27,"end_line":105,"end_character":48},"in_reply_to":"3f79a3b5_a06ebe29","updated":"2018-09-27 13:31:47.000000000","message":"as above","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"5eda6f8863c06181f1da33a0ee3ec3e41a3b2a1d","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        # NOTE(bence romsics): This method gets called a lot, keep it quick."},{"line_number":167,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":168,"context_line":"            return"},{"line_number":169,"context_line":"        if \u0027rp_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":170,"context_line":"            LOG.warning("},{"line_number":171,"context_line":"                \"The mechanism driver claims agent type supports \""},{"line_number":172,"context_line":"                \"placement reports, but the agent does not report \""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_14190222","line":169,"range":{"start_line":169,"start_character":12,"end_line":169,"end_character":25},"updated":"2018-09-26 17:41:19.000000000","message":"Please, can you point me to the patch with this change? I don\u0027t see this driver configuration. Is in the extensions?","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"967ef575424486ca4fb86e752b4f96d54589a89f","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        # NOTE(bence romsics): This method gets called a lot, keep it quick."},{"line_number":167,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":168,"context_line":"            return"},{"line_number":169,"context_line":"        if \u0027rp_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":170,"context_line":"            LOG.warning("},{"line_number":171,"context_line":"                \"The mechanism driver claims agent type supports \""},{"line_number":172,"context_line":"                \"placement reports, but the agent does not report \""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_d5ab72d4","line":169,"range":{"start_line":169,"start_character":12,"end_line":169,"end_character":25},"in_reply_to":"3f79a3b5_14190222","updated":"2018-09-27 13:31:47.000000000","message":"Of course. There are two changes at the moment. One for ovs-agent and another for sriov-agent:\n\nIb197573e5cdb60ef0db4e7a771c3179bf9d5bb95\nI1af798d404ed94cd30da3f92734bea911bbc3ac7","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"fda8434534d7d24e4d302afc07e3d45732faf5f1","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        # NOTE(bence romsics): This method gets called a lot, keep it quick."},{"line_number":167,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":168,"context_line":"            return"},{"line_number":169,"context_line":"        if \u0027rp_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":170,"context_line":"            LOG.warning("},{"line_number":171,"context_line":"                \"The mechanism driver claims agent type supports \""},{"line_number":172,"context_line":"                \"placement reports, but the agent does not report \""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_e101f1b6","line":169,"range":{"start_line":169,"start_character":12,"end_line":169,"end_character":25},"in_reply_to":"3f79a3b5_d158d825","updated":"2018-10-11 12:09:48.000000000","message":"Thanks.","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"9896039811971d41c597364931e3a439125a9386","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        # NOTE(bence romsics): This method gets called a lot, keep it quick."},{"line_number":167,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":168,"context_line":"            return"},{"line_number":169,"context_line":"        if \u0027rp_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":170,"context_line":"            LOG.warning("},{"line_number":171,"context_line":"                \"The mechanism driver claims agent type supports \""},{"line_number":172,"context_line":"                \"placement reports, but the agent does not report \""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_d158d825","line":169,"range":{"start_line":169,"start_character":12,"end_line":169,"end_character":25},"in_reply_to":"3f79a3b5_d5ab72d4","updated":"2018-10-04 07:43:51.000000000","message":"Just a reminder: for sure you know this better than me, but now this is resource_provider_bandwidths","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"bb6d580e4d2ee8a9d620adf19917c17205698cac","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        # sync the state known by us to placement"},{"line_number":180,"context_line":"        if ("},{"line_number":181,"context_line":"                # agent object in API (re-)created"},{"line_number":182,"context_line":"                status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":183,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":184,"context_line":"                \u0027start_flag\u0027 in agent):"},{"line_number":185,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_494a755b","line":182,"range":{"start_line":182,"start_character":27,"end_line":182,"end_character":47},"updated":"2018-09-27 10:02:37.000000000","message":"You should also add AGENT_REVIVED","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"967ef575424486ca4fb86e752b4f96d54589a89f","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        # sync the state known by us to placement"},{"line_number":180,"context_line":"        if ("},{"line_number":181,"context_line":"                # agent object in API (re-)created"},{"line_number":182,"context_line":"                status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":183,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":184,"context_line":"                \u0027start_flag\u0027 in agent):"},{"line_number":185,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_3541860b","line":182,"range":{"start_line":182,"start_character":27,"end_line":182,"end_character":47},"in_reply_to":"3f79a3b5_494a755b","updated":"2018-09-27 13:31:47.000000000","message":"Are you sure? Can the agent configuration change when we get AGENT_REVIVED? Plus I\u0027d like to avoid load pikes caused by situations when lots of agents change state at the same time - for example when the controllers get partitioned from computes and then re-connected.","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"bb6d580e4d2ee8a9d620adf19917c17205698cac","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if agent_type not in self._agent_type_to_mech_driver:"},{"line_number":218,"context_line":"            for driver in self._mechanism_drivers:"},{"line_number":219,"context_line":"                if agent_type \u003d\u003d driver.obj.agent_type:"},{"line_number":220,"context_line":"                    self._agent_type_to_mech_driver[agent_type] \u003d driver"},{"line_number":221,"context_line":"                    break"},{"line_number":222,"context_line":"        return self._agent_type_to_mech_driver[agent_type]"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_c60af225","line":220,"range":{"start_line":220,"start_character":66,"end_line":220,"end_character":72},"updated":"2018-09-27 10:02:37.000000000","message":"Why don\u0027t you return driver.obj? That way you have the object (***MechanismDriver) itself","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"967ef575424486ca4fb86e752b4f96d54589a89f","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if agent_type not in self._agent_type_to_mech_driver:"},{"line_number":218,"context_line":"            for driver in self._mechanism_drivers:"},{"line_number":219,"context_line":"                if agent_type \u003d\u003d driver.obj.agent_type:"},{"line_number":220,"context_line":"                    self._agent_type_to_mech_driver[agent_type] \u003d driver"},{"line_number":221,"context_line":"                    break"},{"line_number":222,"context_line":"        return self._agent_type_to_mech_driver[agent_type]"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_d5cdb25e","line":220,"range":{"start_line":220,"start_character":66,"end_line":220,"end_character":72},"in_reply_to":"3f79a3b5_c60af225","updated":"2018-09-27 13:31:47.000000000","message":"Done","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"5eda6f8863c06181f1da33a0ee3ec3e41a3b2a1d","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        return self._agent_type_to_mech_driver[agent_type]"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class ResourceProvider(object):"},{"line_number":226,"context_line":"    \"\"\"Query Resource Providers efficiently (ie. cached)."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    If we were to call \u0027resource provider show\u0027 every time we need a"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_51b54cec","line":225,"updated":"2018-09-26 17:41:19.000000000","message":"One of the goals of Placement API is to centralize the resource information and keep it updated and accessible from everywhere. To drawbacks this \"memoize\" class presents (cache all RPs including not needed, no cache eviction, possible cache corruption), we can add the lack of RP data refreshment.\n\nI don\u0027t recommend to use it.","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"967ef575424486ca4fb86e752b4f96d54589a89f","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        return self._agent_type_to_mech_driver[agent_type]"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class ResourceProvider(object):"},{"line_number":226,"context_line":"    \"\"\"Query Resource Providers efficiently (ie. cached)."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    If we were to call \u0027resource provider show\u0027 every time we need a"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_f5deae3a","line":225,"in_reply_to":"3f79a3b5_51b54cec","updated":"2018-09-27 13:31:47.000000000","message":"I agree. This is a remnant of a previous approach, but those assumptions no longer hold. At some point I thought I need to re-sync everything at neutron-server startup, but that\u0027s no longer true. I\u0027ll remove this.","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"fda8434534d7d24e4d302afc07e3d45732faf5f1","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        return self._agent_type_to_mech_driver[agent_type]"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class ResourceProvider(object):"},{"line_number":226,"context_line":"    \"\"\"Query Resource Providers efficiently (ie. cached)."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    If we were to call \u0027resource provider show\u0027 every time we need a"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_e1757101","line":225,"in_reply_to":"3f79a3b5_f5deae3a","updated":"2018-10-11 12:09:48.000000000","message":"Done","commit_id":"00558cf7fe23049127a2ee4a7c2e5279a7206269"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e26bb157e341a086913b4677bb7c528fd14d962f","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        if len(rps) !\u003d 1:"},{"line_number":117,"context_line":"            # FIXME(bence romsics): proper exception type"},{"line_number":118,"context_line":"            raise Exception(_("},{"line_number":119,"context_line":"                \u0027no such resource provider: %(name)s\u0027) % name)"},{"line_number":120,"context_line":"        return rps[0]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def _sync_placement_state(self, agent):"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_d8ad5432","line":119,"range":{"start_line":119,"start_character":16,"end_line":119,"end_character":61},"updated":"2018-10-30 10:19:57.000000000","message":"TypeError: format requires a mapping","commit_id":"0267b8718347c5e3d24201c0a8d09c9a696431f7"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"a6b224114fb685d1028d231aaa88c1c022e08a0b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        if len(rps) !\u003d 1:"},{"line_number":117,"context_line":"            # FIXME(bence romsics): proper exception type"},{"line_number":118,"context_line":"            raise Exception(_("},{"line_number":119,"context_line":"                \u0027no such resource provider: %(name)s\u0027) % name)"},{"line_number":120,"context_line":"        return rps[0]"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    def _sync_placement_state(self, agent):"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_6ed23a35","line":119,"range":{"start_line":119,"start_character":16,"end_line":119,"end_character":61},"in_reply_to":"3f79a3b5_d8ad5432","updated":"2018-10-30 10:20:16.000000000","message":"Done","commit_id":"0267b8718347c5e3d24201c0a8d09c9a696431f7"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"b5fad9c09db971774b4643ebf2d77a5f80ec47e6","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from neutron_lib.callbacks import events"},{"line_number":17,"context_line":"from neutron_lib.callbacks import registry"},{"line_number":18,"context_line":"from neutron_lib.callbacks import resources"},{"line_number":19,"context_line":"# TODO(bence romsics): refactor: replace"},{"line_number":20,"context_line":"# neutron.services.segments.placement_client by neutron_lib.placement.client"},{"line_number":21,"context_line":"from neutron_lib.placement import client as place_client"},{"line_number":22,"context_line":"from neutron_lib.plugins import directory"},{"line_number":23,"context_line":"from neutron_lib.services import base as service_base"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_6a7371e6","line":20,"range":{"start_line":19,"start_character":0,"end_line":20,"end_character":76},"updated":"2019-01-15 15:01:36.000000000","message":"This was done here:\nhttps://review.openstack.org/591383","commit_id":"4a74fa1ec459010cf709da0ce14e6a1b29ecbd4c"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"b5fad9c09db971774b4643ebf2d77a5f80ec47e6","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            # so the later independent calls have a chance to succeed."},{"line_number":76,"context_line":"            except Exception:"},{"line_number":77,"context_line":"                errors +\u003d 1"},{"line_number":78,"context_line":"                # FIXME(bence romsics): LOG.exception() does not log"},{"line_number":79,"context_line":"                # the real error message of exceptions raised in placement"},{"line_number":80,"context_line":"                # client. Since we don\u0027t want to put exception handling code"},{"line_number":81,"context_line":"                # here that\u0027s special to exceptions raised from the placement"},{"line_number":82,"context_line":"                # client, the Placement*Error(error_msg) exceptions should be"},{"line_number":83,"context_line":"                # re-raised from the placement client with error_msg extracted"},{"line_number":84,"context_line":"                # as in the example below."},{"line_number":85,"context_line":"                # LOG.warning(\u0027Unexpected exception in call to placement: \u0027"},{"line_number":86,"context_line":"                #             \u0027%(call)s: %(code)s %(text)s\u0027,"},{"line_number":87,"context_line":"                #             {\u0027call\u0027: str(deferred),"},{"line_number":88,"context_line":"                #              \u0027code\u0027: exc.response.status_code,"},{"line_number":89,"context_line":"                #              \u0027text\u0027: jsonutils.loads(exc.response.text)["},{"line_number":90,"context_line":"                #                          \u0027errors\u0027][0][\u0027detail\u0027]})"},{"line_number":91,"context_line":"                LOG.exception(\u0027Unexpected exception in call to placement\u0027)"},{"line_number":92,"context_line":"            # TODO(bence romsics): To handle transient errors we need to"},{"line_number":93,"context_line":"            # persist the success/failure of the last deferred_batch."}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_4a4f958c","line":90,"range":{"start_line":78,"start_character":0,"end_line":90,"end_character":67},"updated":"2019-01-15 15:01:36.000000000","message":"This was done here:\nhttps://review.openstack.org/619302","commit_id":"4a74fa1ec459010cf709da0ce14e6a1b29ecbd4c"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"b5fad9c09db971774b4643ebf2d77a5f80ec47e6","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        mech_driver \u003d self._agents.mechanism_driver_by_agent_type("},{"line_number":127,"context_line":"            agent[\u0027agent_type\u0027])"},{"line_number":128,"context_line":"        uuid_ns \u003d mech_driver.resource_provider_uuid5_namespace"},{"line_number":129,"context_line":"        # FIXME(bence romsics): Now we put all supported_vnic_types of the"},{"line_number":130,"context_line":"        # relevant mechanism driver as traits on a resource provider. This may"},{"line_number":131,"context_line":"        # be too broad and problematic. Consider: both ovs and sriov mechanism"},{"line_number":132,"context_line":"        # drivers support the \u0027direct\u0027 vnic type. Where the actual ovs support"},{"line_number":133,"context_line":"        # likely depends on a further factors too (ovs version, nic). (Note to"},{"line_number":134,"context_line":"        # myself: I need to look into this deeper.) Today an admin can decide"},{"line_number":135,"context_line":"        # which driver wins for vnic_type\u003d\u003ddirect ports by configuring the"},{"line_number":136,"context_line":"        # mechanism drivers in the proper order. BUT Placement is not going to"},{"line_number":137,"context_line":"        # know about this order. This problem seems to go back to an"},{"line_number":138,"context_line":"        # assumption of the agent mechanism driver base that"},{"line_number":139,"context_line":"        # supported_vnic_types is static enough that it can be represented as"},{"line_number":140,"context_line":"        # a class property. We may need to question that."},{"line_number":141,"context_line":"        supported_vnic_types \u003d mech_driver.supported_vnic_types"},{"line_number":142,"context_line":"        agent_host_rp_uuid \u003d self._get_rp_by_name("},{"line_number":143,"context_line":"            name\u003dagent[\u0027host\u0027])[\u0027uuid\u0027]"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_ea0ea13a","line":140,"range":{"start_line":129,"start_character":0,"end_line":140,"end_character":57},"updated":"2019-01-15 15:01:36.000000000","message":"This was done by the following changes:\nhttps://review.openstack.org/601600\nhttps://review.openstack.org/606034","commit_id":"4a74fa1ec459010cf709da0ce14e6a1b29ecbd4c"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c1359961a8e282fff59b1c12001a52944b9cbff4","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _get_rp_by_name(self, name):"},{"line_number":63,"context_line":"        rps \u003d self._placement_client.list_resource_providers("},{"line_number":64,"context_line":"            name\u003dname)[\u0027resource_providers\u0027]"},{"line_number":65,"context_line":"        # RP names are unique, therefore we can get 0 or 1. But not many."},{"line_number":66,"context_line":"        if len(rps) !\u003d 1:"},{"line_number":67,"context_line":"            # NOTE(bence romsics): While we could raise() here and by detect"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_5ae26ea2","line":64,"range":{"start_line":64,"start_character":17,"end_line":64,"end_character":21},"updated":"2019-02-20 22:44:43.000000000","message":"I am not sure if this is the problem of my setup or it is a bug. While I was testing this patch, it couldn\u0027t find the resource provider.\n\nI saw the neutron agent host is \u0027allinone\u0027 but the resource provider in placement is \u0027allinone.devstack.dev\u0027. Therefore, the name is not matched so we couldn\u0027t find the resource provider in here.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"423d34970f16aad57014c8f9e0ea0d8c639051f5","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _get_rp_by_name(self, name):"},{"line_number":63,"context_line":"        rps \u003d self._placement_client.list_resource_providers("},{"line_number":64,"context_line":"            name\u003dname)[\u0027resource_providers\u0027]"},{"line_number":65,"context_line":"        # RP names are unique, therefore we can get 0 or 1. But not many."},{"line_number":66,"context_line":"        if len(rps) !\u003d 1:"},{"line_number":67,"context_line":"            # NOTE(bence romsics): While we could raise() here and by detect"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_d04dd599","line":64,"range":{"start_line":64,"start_character":17,"end_line":64,"end_character":21},"in_reply_to":"9fdfeff1_5ae26ea2","updated":"2019-02-21 12:47:50.000000000","message":"I don\u0027t have this problem in my environment. AFAICT these are the two sides of the host name matching code in nova and neutron:\n\n* https://github.com/openstack/neutron-lib/blob/044ca8e3e4a07502eb4fb89d1425502750628cba/neutron_lib/utils/net.py#L20\n* https://github.com/openstack/nova/blob/34e595f2a7ac1cd16ea13d0e3a14899b89f94998/nova/conf/netconf.py#L56\n\nSo far that looks consistent, so in itself it shouldn\u0027t lead to the problem you\u0027re seeing.\n\n* Do you have any host name setting in any of your per-host nova and/or neutron config files?\n\n* Do you have any config controlling if your services use single element hostnames or fqdns?\n\n* Does port binding work in your devstack? If it does then what\u0027s the binding:host value of a successfully bound port?","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c1359961a8e282fff59b1c12001a52944b9cbff4","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        supported_vnic_types \u003d mech_driver.supported_vnic_types"},{"line_number":82,"context_line":"        device_mappings \u003d mech_driver.get_standard_device_mappings(agent)"},{"line_number":83,"context_line":"        agent_host_rp_uuid \u003d self._get_rp_by_name("},{"line_number":84,"context_line":"            name\u003dagent[\u0027host\u0027])[\u0027uuid\u0027]"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        state \u003d placement_report.PlacementState("},{"line_number":87,"context_line":"            rp_bandwidths\u003dconfigurations["}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_1ae70649","line":84,"range":{"start_line":84,"start_character":31,"end_line":84,"end_character":39},"updated":"2019-02-20 22:44:43.000000000","message":"Here doesn\u0027t handle the case that _get_rp_by_name return None, which will cause failure.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"423d34970f16aad57014c8f9e0ea0d8c639051f5","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        supported_vnic_types \u003d mech_driver.supported_vnic_types"},{"line_number":82,"context_line":"        device_mappings \u003d mech_driver.get_standard_device_mappings(agent)"},{"line_number":83,"context_line":"        agent_host_rp_uuid \u003d self._get_rp_by_name("},{"line_number":84,"context_line":"            name\u003dagent[\u0027host\u0027])[\u0027uuid\u0027]"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        state \u003d placement_report.PlacementState("},{"line_number":87,"context_line":"            rp_bandwidths\u003dconfigurations["}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_3368ebb8","line":84,"range":{"start_line":84,"start_character":31,"end_line":84,"end_character":39},"in_reply_to":"9fdfeff1_1ae70649","updated":"2019-02-21 12:47:50.000000000","message":"Good catch. On the other hand I want it to cause a failure just a tiny bit later in the \u0027try\u0027 in line 120.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c1359961a8e282fff59b1c12001a52944b9cbff4","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        # sync the state known by us to placement"},{"line_number":169,"context_line":"        if ("},{"line_number":170,"context_line":"                # agent object in API (re-)created"},{"line_number":171,"context_line":"                status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_550001ac","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":50},"updated":"2019-02-20 22:44:43.000000000","message":"Do we need to do this when the agent is restarted? Each restart will pickup changes from config file so might worth to do the sync again.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"a0b2aa62c721c8222f1c4eebb739ca085cc6c57b","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        # sync the state known by us to placement"},{"line_number":169,"context_line":"        if ("},{"line_number":170,"context_line":"                # agent object in API (re-)created"},{"line_number":171,"context_line":"                status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_978c08d8","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":50},"in_reply_to":"9fdfeff1_138b6768","updated":"2019-02-22 15:09:19.000000000","message":"I see.\n\nI am thinking of a scenario that operators might change the resource provider bandwidth in config file, and then they might restart the agent and expect the agent pick up the bandwidth and do a full resync. But if the resync doesn\u0027t happen this way, they might be surprised.\n\nHowever, I don\u0027t have strong opinion on this. Just want to point it out.\n\nBTW. I will take a closer look at this patch later.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"423d34970f16aad57014c8f9e0ea0d8c639051f5","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        # sync the state known by us to placement"},{"line_number":169,"context_line":"        if ("},{"line_number":170,"context_line":"                # agent object in API (re-)created"},{"line_number":171,"context_line":"                status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_138b6768","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":50},"in_reply_to":"9fdfeff1_550001ac","updated":"2019-02-21 12:47:50.000000000","message":"Not necessarily. I wanted to give an option to the admin to force resync even without an agent restart. IIRC an agent restart can occasionally be disruptive on the data path for some agents for some type of networks. But those old memories of mine may no longer be true.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"bcec3c2e5af2ffa64d571a34d59975d3bd1cc483","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        # sync the state known by us to placement"},{"line_number":169,"context_line":"        if ("},{"line_number":170,"context_line":"                # agent object in API (re-)created"},{"line_number":171,"context_line":"                status \u003d\u003d agent_const.AGENT_NEW or"},{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"}],"source_content_type":"text/x-python","patch_set":26,"id":"9fdfeff1_131fac6c","line":170,"range":{"start_line":170,"start_character":43,"end_line":170,"end_character":50},"in_reply_to":"9fdfeff1_978c08d8","updated":"2019-02-25 13:50:52.000000000","message":"\u003e I am thinking of a scenario that operators might change the\n \u003e resource provider bandwidth in config file, and then they might\n \u003e restart the agent and expect the agent pick up the bandwidth and do\n \u003e a full resync.\n\nThis is going to trigger a resync by itself.\n\n \u003e But if the resync doesn\u0027t happen this way, they\n \u003e might be surprised.\n\nI agree, that would be surprising. Deleting and re-creating the agent record is not necessary after an agent restart. But deleting and re-creating the agent record can be an alternative to restarting the agent. I\u0027m starting to remember why I added this OR-red condition. :-) If somebody/something outside of neutron edits the placement db contents you can force a resync from neutron by this without restarting the agent.\n\n \u003e BTW. I will take a closer look at this patch later.\n\nThanks in advance.","commit_id":"0c1b9de40695f78e491551d5e65633b34a4ec97d"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"426dec453ddff400126e8b9cbfa7a27e8a303a19","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @classmethod"},{"line_number":42,"context_line":"    def get_plugin_type(cls):"},{"line_number":43,"context_line":"        return \"placement_report\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_plugin_description(self):"},{"line_number":46,"context_line":"        return \"Sync placement info from agent to server to placement.\""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_41e542a3","line":43,"range":{"start_line":43,"start_character":16,"end_line":43,"end_character":32},"updated":"2019-02-26 15:47:11.000000000","message":"Better to use a constant in here.","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e064e098b74189658c54f945a2cfb40a4814e521","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @classmethod"},{"line_number":42,"context_line":"    def get_plugin_type(cls):"},{"line_number":43,"context_line":"        return \"placement_report\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_plugin_description(self):"},{"line_number":46,"context_line":"        return \"Sync placement info from agent to server to placement.\""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_d6b7a4d7","line":43,"range":{"start_line":43,"start_character":16,"end_line":43,"end_character":32},"in_reply_to":"9fdfeff1_41e542a3","updated":"2019-02-27 08:38:31.000000000","message":"Done","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"426dec453ddff400126e8b9cbfa7a27e8a303a19","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                        str(deferred))"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"            resources_synced \u003d not bool(errors)"},{"line_number":130,"context_line":"            agent_db.update_fields({\u0027resources_synced\u0027: resources_synced})"},{"line_number":131,"context_line":"            agent_db.update()"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"            LOG.debug("}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_c445c045","line":130,"range":{"start_line":130,"start_character":12,"end_line":130,"end_character":74},"updated":"2019-02-26 15:47:11.000000000","message":"nit: I guess you can do the following instead. It reads better IMO:\n\n  agent_db.resources_synced \u003d resources_synced","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e064e098b74189658c54f945a2cfb40a4814e521","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                        str(deferred))"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"            resources_synced \u003d not bool(errors)"},{"line_number":130,"context_line":"            agent_db.update_fields({\u0027resources_synced\u0027: resources_synced})"},{"line_number":131,"context_line":"            agent_db.update()"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"            LOG.debug("}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_96ad9c85","line":130,"range":{"start_line":130,"start_character":12,"end_line":130,"end_character":74},"in_reply_to":"9fdfeff1_c445c045","updated":"2019-02-27 08:38:31.000000000","message":"Done","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"426dec453ddff400126e8b9cbfa7a27e8a303a19","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        status \u003d payload.metadata.get(\u0027status\u0027)"},{"line_number":150,"context_line":"        context \u003d payload.context"},{"line_number":151,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":152,"context_line":"            return"},{"line_number":153,"context_line":"        if \u0027resource_provider_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":154,"context_line":"            LOG.warning("},{"line_number":155,"context_line":"                \"The mechanism driver claims agent type supports \""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_84e81816","line":152,"range":{"start_line":152,"start_character":12,"end_line":152,"end_character":18},"updated":"2019-02-26 15:47:11.000000000","message":"nit: it might be useful to log a debug message before return.","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"fef4c5e91e0f620ecacfbc5d68d021772922b6e3","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        status \u003d payload.metadata.get(\u0027status\u0027)"},{"line_number":150,"context_line":"        context \u003d payload.context"},{"line_number":151,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":152,"context_line":"            return"},{"line_number":153,"context_line":"        if \u0027resource_provider_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":154,"context_line":"            LOG.warning("},{"line_number":155,"context_line":"                \"The mechanism driver claims agent type supports \""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_cc3ce3c0","line":152,"range":{"start_line":152,"start_character":12,"end_line":152,"end_character":18},"in_reply_to":"9fdfeff1_56d094f7","updated":"2019-02-27 20:34:13.000000000","message":"I see. Never mind.","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e064e098b74189658c54f945a2cfb40a4814e521","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        status \u003d payload.metadata.get(\u0027status\u0027)"},{"line_number":150,"context_line":"        context \u003d payload.context"},{"line_number":151,"context_line":"        if agent[\u0027agent_type\u0027] not in self._agents.supported_agent_types:"},{"line_number":152,"context_line":"            return"},{"line_number":153,"context_line":"        if \u0027resource_provider_bandwidths\u0027 not in agent[\u0027configurations\u0027]:"},{"line_number":154,"context_line":"            LOG.warning("},{"line_number":155,"context_line":"                \"The mechanism driver claims agent type supports \""}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_56d094f7","line":152,"range":{"start_line":152,"start_character":12,"end_line":152,"end_character":18},"in_reply_to":"9fdfeff1_84e81816","updated":"2019-02-27 08:38:31.000000000","message":"That would lead to a debug log message every 30 seconds from every agent that\u0027s not sending rp_bandwidths. That is all l3, dhcp and non-ovs or non-sriov l2 agents. Are you sure you want that?","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"426dec453ddff400126e8b9cbfa7a27e8a303a19","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":174,"context_line":"                # never tried to sync yet or last sync failed"},{"line_number":175,"context_line":"                not agent_db[\u0027resources_synced\u0027]):"},{"line_number":176,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":177,"context_line":"            self._sync_placement_state(agent, agent_db)"},{"line_number":178,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_a4a51cb7","line":175,"range":{"start_line":175,"start_character":30,"end_line":175,"end_character":46},"updated":"2019-02-26 15:47:11.000000000","message":"If \u0027resources_synced\u0027 is not in agent_db, this will raise a KeyError. A safer approach is \"agent_db.get(\u0027resources_synced\u0027).\n\nAnother nitpick is that we could use the RESOURCES_SYNCED constant instead: http://git.openstack.org/cgit/openstack/neutron-lib/tree/neutron_lib/api/definitions/agent_resources_synced.py#n27","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"31a199de2c50087848443205df9b05181ad61577","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":174,"context_line":"                # never tried to sync yet or last sync failed"},{"line_number":175,"context_line":"                not agent_db[\u0027resources_synced\u0027]):"},{"line_number":176,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":177,"context_line":"            self._sync_placement_state(agent, agent_db)"},{"line_number":178,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_4ff53b50","line":175,"range":{"start_line":175,"start_character":30,"end_line":175,"end_character":46},"in_reply_to":"9fdfeff1_2c61efa9","updated":"2019-02-28 08:23:25.000000000","message":"This service plugin depends on ML2. It is not going to work with out-of-tree core plugins. Please see for example class PlacementReporterAgents below.\n\nMaybe I should add this fact in a more prominent comment at the beginning of the file?","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e064e098b74189658c54f945a2cfb40a4814e521","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":174,"context_line":"                # never tried to sync yet or last sync failed"},{"line_number":175,"context_line":"                not agent_db[\u0027resources_synced\u0027]):"},{"line_number":176,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":177,"context_line":"            self._sync_placement_state(agent, agent_db)"},{"line_number":178,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_b69f8000","line":175,"range":{"start_line":175,"start_character":30,"end_line":175,"end_character":46},"in_reply_to":"9fdfeff1_a4a51cb7","updated":"2019-02-27 08:38:31.000000000","message":"Changed to use the constant.\n\nI\u0027m not sure I agree with using agent_db.get(). This service plugin wil be first released in Stein. In the same release (merged before this) the agent_db db table and ovo object unconditionally contain the resources_synced field. If somebody manages to run neutron-server where agent_db does not have this field (for example I guess they forgot to upgrade their db schema) I think that situation should appear loud and clear in the logs because it needs to get fixed.\n\nDo I miss a situation in which agent_db could not have the resources_synced field in a different way?","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"fef4c5e91e0f620ecacfbc5d68d021772922b6e3","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                # agent (re-)started (even without config change)"},{"line_number":173,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":174,"context_line":"                # never tried to sync yet or last sync failed"},{"line_number":175,"context_line":"                not agent_db[\u0027resources_synced\u0027]):"},{"line_number":176,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":177,"context_line":"            self._sync_placement_state(agent, agent_db)"},{"line_number":178,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_2c61efa9","line":175,"range":{"start_line":175,"start_character":30,"end_line":175,"end_character":46},"in_reply_to":"9fdfeff1_b69f8000","updated":"2019-02-27 20:34:13.000000000","message":"What I was thinking is a scenario that there is a out-of-tree core plugin which doesn\u0027t have the \u0027agent_resource_synced\u0027 extension thus does not have this field.\n\nHowever, this might not be a realistic scenario so I am fine with current approach.","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"426dec453ddff400126e8b9cbfa7a27e8a303a19","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            # the driver\u0027s agent type. But we could introduce a property/logic"},{"line_number":197,"context_line":"            # explicitly describing the agent types supporting placement"},{"line_number":198,"context_line":"            # reports any time if this proved to be insufficient."},{"line_number":199,"context_line":"            self._supported_agent_types \u003d ["},{"line_number":200,"context_line":"                driver.obj.agent_type for driver"},{"line_number":201,"context_line":"                in self._mechanism_drivers"},{"line_number":202,"context_line":"                if driver.obj.resource_provider_uuid5_namespace is not None]"},{"line_number":203,"context_line":"            LOG.debug(\u0027agent types supporting placement reports: %s\u0027,"},{"line_number":204,"context_line":"                \u0027, \u0027.join(self._supported_agent_types))"},{"line_number":205,"context_line":"        return self._supported_agent_types"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_e44004a5","line":202,"range":{"start_line":199,"start_character":0,"end_line":202,"end_character":76},"updated":"2019-02-26 15:47:11.000000000","message":"nit: it reads better if we change to the following:\n\n            self._supported_agent_types \u003d [\n                driver.obj.agent_type\n                for driver in self._mechanism_drivers\n                if driver.obj.resource_provider_uuid5_namespace is not None]","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e064e098b74189658c54f945a2cfb40a4814e521","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            # the driver\u0027s agent type. But we could introduce a property/logic"},{"line_number":197,"context_line":"            # explicitly describing the agent types supporting placement"},{"line_number":198,"context_line":"            # reports any time if this proved to be insufficient."},{"line_number":199,"context_line":"            self._supported_agent_types \u003d ["},{"line_number":200,"context_line":"                driver.obj.agent_type for driver"},{"line_number":201,"context_line":"                in self._mechanism_drivers"},{"line_number":202,"context_line":"                if driver.obj.resource_provider_uuid5_namespace is not None]"},{"line_number":203,"context_line":"            LOG.debug(\u0027agent types supporting placement reports: %s\u0027,"},{"line_number":204,"context_line":"                \u0027, \u0027.join(self._supported_agent_types))"},{"line_number":205,"context_line":"        return self._supported_agent_types"}],"source_content_type":"text/x-python","patch_set":29,"id":"9fdfeff1_368b90c0","line":202,"range":{"start_line":199,"start_character":0,"end_line":202,"end_character":76},"in_reply_to":"9fdfeff1_e44004a5","updated":"2019-02-27 08:38:31.000000000","message":"Done","commit_id":"26d1e10b507b2d286d9e54cdc2074aacc61b8673"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7aacb1db2e96f9f603a8b164ef004b8987e540d5","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                    LOG.debug(\u0027placement client: {}\u0027.format(deferred))"},{"line_number":125,"context_line":"                    deferred.execute()"},{"line_number":126,"context_line":"                except Exception:"},{"line_number":127,"context_line":"                    errors +\u003d 1"},{"line_number":128,"context_line":"                    LOG.exception("},{"line_number":129,"context_line":"                        \u0027placement client call failed: %s\u0027,"},{"line_number":130,"context_line":"                        str(deferred))"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_52f5e04f","line":127,"updated":"2019-02-28 09:18:19.000000000","message":"You don\u0027t need to count them as it\u0027s not used anywhere. You can just simply set True here and then You don\u0027t need to do conversion to bool in L132","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"10649a4f9fe9b24e6e95596eaf904e07364687f1","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                    LOG.debug(\u0027placement client: {}\u0027.format(deferred))"},{"line_number":125,"context_line":"                    deferred.execute()"},{"line_number":126,"context_line":"                except Exception:"},{"line_number":127,"context_line":"                    errors +\u003d 1"},{"line_number":128,"context_line":"                    LOG.exception("},{"line_number":129,"context_line":"                        \u0027placement client call failed: %s\u0027,"},{"line_number":130,"context_line":"                        str(deferred))"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_b2c1a782","line":127,"in_reply_to":"9fdfeff1_52f5e04f","updated":"2019-02-28 15:04:57.000000000","message":"Done","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7aacb1db2e96f9f603a8b164ef004b8987e540d5","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # We need to get the same agent as in"},{"line_number":167,"context_line":"        # neutron.db.agents_db.AgentDbMixin.create_or_update_agent()"},{"line_number":168,"context_line":"        agent_db \u003d self._core_plugin._get_agent_by_type_and_host("},{"line_number":169,"context_line":"            context, agent[\u0027agent_type\u0027], agent[\u0027host\u0027])"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        # sync the state known by us to placement"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_d2b79084","line":168,"updated":"2019-02-28 09:18:19.000000000","message":"This can raise AgentNotFoundByTypeHost or MultipleAgentFoundByTypeHost exceptions, is it fine if this will \"explode\" here or maybe You should handle them somehow?","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"10649a4f9fe9b24e6e95596eaf904e07364687f1","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # We need to get the same agent as in"},{"line_number":167,"context_line":"        # neutron.db.agents_db.AgentDbMixin.create_or_update_agent()"},{"line_number":168,"context_line":"        agent_db \u003d self._core_plugin._get_agent_by_type_and_host("},{"line_number":169,"context_line":"            context, agent[\u0027agent_type\u0027], agent[\u0027host\u0027])"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        # sync the state known by us to placement"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_f213af63","line":168,"in_reply_to":"9fdfeff1_d2b79084","updated":"2019-02-28 15:04:57.000000000","message":"I don\u0027t think those exceptions should ever be raised here.\n\nHere we\u0027re handling an AFTER_CREATE or AFTER_UPDATE agent event. And we\u0027re calling _get_agent_by_type_and_host() with the same arguments as here:\n\nhttps://github.com/openstack/neutron/blob/376fa8aef49fa45c7038be4648aecd6899fb8d4e/neutron/db/agents_db.py#L393\n\nIn the AFTER_UPDATE case _get_agent_by_type_and_host() should not raise here as it did not raise in neutron.db.agents_db.AgentDbMixin.create_or_update_agent().\n\nIn the AFTER_CREATE case _get_agent_by_type_and_host() raised AgentNotFoundByTypeHost in create_or_update_agent. That was caught there and here we should get back the agent that was just freshly created in the exception handler there. So again here _get_agent_by_type_and_host().\n\nI\u0027m a bit less sure about exception MultipleAgentFoundByTypeHost. It is not handled in create_or_update_agent() either. But as I currently understand the create-or-update logic prevents MultipleAgentFoundByTypeHost to be ever raised.\n\nNow technically all the above is somewhat racy because registry.publish() is called outside of transaction, so there\u0027s a tiny window when the agent records might have changed between the two calls to _get_agent_by_type_and_host().\n\nEven if I start handling these exceptions here what else can I do than log an error message? In that case the stack trace logged by default looks actually useful to me.","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7aacb1db2e96f9f603a8b164ef004b8987e540d5","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":177,"context_line":"                # never tried to sync yet or last sync failed"},{"line_number":178,"context_line":"                not agent_db[agent_resources_synced.RESOURCES_SYNCED]):"},{"line_number":179,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":180,"context_line":"            self._sync_placement_state(agent, agent_db)"},{"line_number":181,"context_line":"        else:"},{"line_number":182,"context_line":"            LOG.debug(\u0027placement: nothing to sync\u0027)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_f263b418","line":179,"updated":"2019-02-28 09:18:19.000000000","message":"nit: maybe add info about agent for which state is syncing","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"10649a4f9fe9b24e6e95596eaf904e07364687f1","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                \u0027start_flag\u0027 in agent or"},{"line_number":177,"context_line":"                # never tried to sync yet or last sync failed"},{"line_number":178,"context_line":"                not agent_db[agent_resources_synced.RESOURCES_SYNCED]):"},{"line_number":179,"context_line":"            LOG.debug(\u0027placement: syncing state\u0027)"},{"line_number":180,"context_line":"            self._sync_placement_state(agent, agent_db)"},{"line_number":181,"context_line":"        else:"},{"line_number":182,"context_line":"            LOG.debug(\u0027placement: nothing to sync\u0027)"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_266499b8","line":179,"in_reply_to":"9fdfeff1_f263b418","updated":"2019-02-28 15:04:57.000000000","message":"Done","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"7aacb1db2e96f9f603a8b164ef004b8987e540d5","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class PlacementReporterAgents(object):"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Yep, this is meant to depend on ML2."},{"line_number":188,"context_line":"    def __init__(self, ml2_plugin):"},{"line_number":189,"context_line":"        self._mechanism_drivers \u003d ml2_plugin.mechanism_manager.\\"},{"line_number":190,"context_line":"            ordered_mech_drivers"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_fd2b857e","line":187,"updated":"2019-02-28 09:18:19.000000000","message":"I\u0027m not sure if that is good idea to make this service plugin to be depend on ML2.\nMaybe adding some \"placement drivers\" in similar way like it is done for e.g. QOS service plugin would be better idea.","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1b4abcde7fb83a20ab0e9f0469b4618813a5b2f0","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class PlacementReporterAgents(object):"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Yep, this is meant to depend on ML2."},{"line_number":188,"context_line":"    def __init__(self, ml2_plugin):"},{"line_number":189,"context_line":"        self._mechanism_drivers \u003d ml2_plugin.mechanism_manager.\\"},{"line_number":190,"context_line":"            ordered_mech_drivers"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_eeccfa63","line":187,"in_reply_to":"9fdfeff1_1b1e5e74","updated":"2019-03-02 17:21:41.000000000","message":"I\u0027m definitely open to improve this as a followup in Train. On the other hand I don\u0027t want to blindly commit to a design I don\u0027t understand properly at the moment.\n\nFor example as much as I understand the qos drivers they correspond 1-to-1 to mechanism drivers, right? Here this is not the case, this can handle all agent based mechanism drivers at once.\n\nAnother seeming difference is that the qos drivers take full responsibility of handling some API calls, but here we don\u0027t want to take full responsibility of an agent update.\n\nMaybe we should open an RFE to track the followup? When I have time after this crazy period before FF I\u0027ll read through the qos driver stuff and we can discuss how to adapt it to this case in the RFE?\n\nHow does that sound?","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b209cab5bab801c854628757e5de53c5c8721c0c","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class PlacementReporterAgents(object):"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Yep, this is meant to depend on ML2."},{"line_number":188,"context_line":"    def __init__(self, ml2_plugin):"},{"line_number":189,"context_line":"        self._mechanism_drivers \u003d ml2_plugin.mechanism_manager.\\"},{"line_number":190,"context_line":"            ordered_mech_drivers"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_1b1e5e74","line":187,"in_reply_to":"9fdfeff1_a6688920","updated":"2019-03-02 14:41:31.000000000","message":"Maybe we can merge it as it is now but with TODO note here and redesign it to be based on drivers in Train cycle? What do You think about it?","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"da73f32219f12432a243447866a610875ac4e28f","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class PlacementReporterAgents(object):"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Yep, this is meant to depend on ML2."},{"line_number":188,"context_line":"    def __init__(self, ml2_plugin):"},{"line_number":189,"context_line":"        self._mechanism_drivers \u003d ml2_plugin.mechanism_manager.\\"},{"line_number":190,"context_line":"            ordered_mech_drivers"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_2e69a2f7","line":187,"in_reply_to":"9fdfeff1_eeccfa63","updated":"2019-03-02 18:33:11.000000000","message":"Sounds like a plan for me :)","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"10649a4f9fe9b24e6e95596eaf904e07364687f1","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class PlacementReporterAgents(object):"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Yep, this is meant to depend on ML2."},{"line_number":188,"context_line":"    def __init__(self, ml2_plugin):"},{"line_number":189,"context_line":"        self._mechanism_drivers \u003d ml2_plugin.mechanism_manager.\\"},{"line_number":190,"context_line":"            ordered_mech_drivers"}],"source_content_type":"text/x-python","patch_set":30,"id":"9fdfeff1_a6688920","line":187,"in_reply_to":"9fdfeff1_fd2b857e","updated":"2019-02-28 15:04:57.000000000","message":"This is a really interesting and relevant comment, but to be honest I\u0027m quite afraid of deeply redesigning this change one week before the feature freeze. What shall we do?","commit_id":"8715f37ba912199ea5e6b0324e64a30ddafd65d2"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"5232ffc47d38afe4d2ea6d9594609b8882532b40","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        uuid_ns \u003d mech_driver.resource_provider_uuid5_namespace"},{"line_number":84,"context_line":"        supported_vnic_types \u003d mech_driver.supported_vnic_types"},{"line_number":85,"context_line":"        device_mappings \u003d mech_driver.get_standard_device_mappings(agent)"},{"line_number":86,"context_line":"        agent_host_rp_uuid \u003d self._get_rp_by_name("},{"line_number":87,"context_line":"            name\u003dagent[\u0027host\u0027])[\u0027uuid\u0027]"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        state \u003d placement_report.PlacementState("}],"source_content_type":"text/x-python","patch_set":31,"id":"9fdfeff1_99310da5","line":86,"range":{"start_line":86,"start_character":34,"end_line":86,"end_character":49},"updated":"2019-03-01 11:18:23.000000000","message":"We should catch keystoneclient exceptions here.","commit_id":"6c6a8cf1c5520f4f98c83f2ae5cef9358b5ff3b5"}]}
