)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8214d9238095eea90a157cb0be0d65c5f48ad639","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Only construct SchedulerReportClient on first access from API"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With commit 5d1a50018510b2b281ad33895ae2d9555f5d5b05 each"},{"line_number":10,"context_line":"API/AggregateAPI class instance constructs a SchedulerReportClient"},{"line_number":11,"context_line":"which holds an in-memory lock during its initialization."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_17a45204","line":9,"range":{"start_line":9,"start_character":12,"end_line":9,"end_character":52},"updated":"2018-12-06 18:57:46.000000000","message":"As for this, yes we definitely did lazy-load before this because looking at n-api logs in a rocky change I don\u0027t see the _create_client lock message on n-api startup:\n\nhttp://logs.openstack.org/periodic/git.openstack.org/openstack/neutron-lbaas/stable/rocky/neutron-lbaas-to-octavia-migration/59d3971/controller/logs/screen-n-api.txt.gz","commit_id":"6ac2b16d26cf1bb48bb44dcb74a55015cde00aa7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf3900e4483d3887d97844cb59bb05b158f118f7","unresolved":false,"context_lines":[{"line_number":11,"context_line":"which holds an in-memory lock during its initialization."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"With at least 34 API extensions constructing at least"},{"line_number":14,"context_line":"one of those two API classes, the accumulated affect of the"},{"line_number":15,"context_line":"SchedulerReportClient construction can slow down nova-api startup"},{"line_number":16,"context_line":"times, especially when running with multiple API workers, like"},{"line_number":17,"context_line":"in our tempest-full CI job (there are 2 workers, so 68 inits)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_aeb98fc6","line":14,"range":{"start_line":14,"start_character":46,"end_line":14,"end_character":52},"updated":"2018-12-06 16:35:06.000000000","message":"effect?","commit_id":"6ac2b16d26cf1bb48bb44dcb74a55015cde00aa7"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"740d733422f0b07b1240a2cb358a8a1d00e39a50","unresolved":false,"context_lines":[{"line_number":11,"context_line":"which holds an in-memory lock during its initialization."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"With at least 34 API extensions constructing at least"},{"line_number":14,"context_line":"one of those two API classes, the accumulated affect of the"},{"line_number":15,"context_line":"SchedulerReportClient construction can slow down nova-api startup"},{"line_number":16,"context_line":"times, especially when running with multiple API workers, like"},{"line_number":17,"context_line":"in our tempest-full CI job (there are 2 workers, so 68 inits)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_6f984eca","line":14,"range":{"start_line":14,"start_character":46,"end_line":14,"end_character":52},"in_reply_to":"3f79a3b5_aeb98fc6","updated":"2018-12-06 21:32:11.000000000","message":"yes","commit_id":"6ac2b16d26cf1bb48bb44dcb74a55015cde00aa7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fc14de5a069ee12ea7fb8e049d514c674bc5ee4d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With commit 5d1a50018510b2b281ad33895ae2d9555f5d5b05 each"},{"line_number":10,"context_line":"API/AggregateAPI class instance constructs a SchedulerReportClient"},{"line_number":11,"context_line":"which holds an in-memory lock during its initialization."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"With at least 34 API extensions constructing at least"},{"line_number":14,"context_line":"one of those two API classes, the accumulated affect of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_ee921556","line":11,"updated":"2018-12-07 13:14:29.000000000","message":"why is a lock being held constructing SchedulerReportClient, though? isn\u0027t that really the source of the problem?","commit_id":"c6380461f02b1a95551f26d27fd0af21f4bbb721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5d5070a990f608e82a6c897eb5d822f29a5a12f1","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With commit 5d1a50018510b2b281ad33895ae2d9555f5d5b05 each"},{"line_number":10,"context_line":"API/AggregateAPI class instance constructs a SchedulerReportClient"},{"line_number":11,"context_line":"which holds an in-memory lock during its initialization."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"With at least 34 API extensions constructing at least"},{"line_number":14,"context_line":"one of those two API classes, the accumulated affect of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_631477ec","line":11,"in_reply_to":"3f79a3b5_c19287fb","updated":"2018-12-12 17:36:22.000000000","message":"The lock is removed in a follow up:\n\nhttps://review.openstack.org/#/c/624770/\n\nSo the changes can be decoupled in case one needs to be reverted.","commit_id":"c6380461f02b1a95551f26d27fd0af21f4bbb721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f228638f5ba8d68eae4d4dfd4a03c8f9501cc0b3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With commit 5d1a50018510b2b281ad33895ae2d9555f5d5b05 each"},{"line_number":10,"context_line":"API/AggregateAPI class instance constructs a SchedulerReportClient"},{"line_number":11,"context_line":"which holds an in-memory lock during its initialization."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"With at least 34 API extensions constructing at least"},{"line_number":14,"context_line":"one of those two API classes, the accumulated affect of the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_c19287fb","line":11,"in_reply_to":"3f79a3b5_ee921556","updated":"2018-12-07 16:11:36.000000000","message":"I don\u0027t know - historical reasons I\u0027m sure, but I\u0027d hope that between you, Eric and Chris you guys would know, since you guys have all been working on that over the years including I\u0027m sure when the lock was added:\n\nhttps://review.openstack.org/#/c/493536/","commit_id":"c6380461f02b1a95551f26d27fd0af21f4bbb721"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fc14de5a069ee12ea7fb8e049d514c674bc5ee4d","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Long-term we could consider making it a singleton in nova.compute.api"},{"line_number":28,"context_line":"if that is safe (the aggregate code might be relying on some caching"},{"line_number":29,"context_line":"aspects in the SchedulerReportClient)."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Change-Id: Idf6e548d725db0181629a451f46b6a3a5850d186"},{"line_number":32,"context_line":"Closes-Bug: #1807219"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_4e730950","line":29,"updated":"2018-12-07 13:14:29.000000000","message":"no, it doesn\u0027t. I specifically designed the aggregate code not to touch the provider tree (the cache) because of this reason.","commit_id":"c6380461f02b1a95551f26d27fd0af21f4bbb721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f228638f5ba8d68eae4d4dfd4a03c8f9501cc0b3","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Long-term we could consider making it a singleton in nova.compute.api"},{"line_number":28,"context_line":"if that is safe (the aggregate code might be relying on some caching"},{"line_number":29,"context_line":"aspects in the SchedulerReportClient)."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"Change-Id: Idf6e548d725db0181629a451f46b6a3a5850d186"},{"line_number":32,"context_line":"Closes-Bug: #1807219"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f79a3b5_84ec9d27","line":29,"in_reply_to":"3f79a3b5_4e730950","updated":"2018-12-07 16:11:36.000000000","message":"OK true:\n\nhttps://github.com/openstack/nova/blob/4d8baef8dcdb63aa60f73b117d77459cb35a2b50/nova/scheduler/client/report.py#L2325\n\nI thought there was some lingering todo to leverage that somewhere, but I must be mistaken.","commit_id":"c6380461f02b1a95551f26d27fd0af21f4bbb721"}],"nova/api/openstack/compute/services.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fc14de5a069ee12ea7fb8e049d514c674bc5ee4d","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                # remove the corresponding resource provider record from"},{"line_number":245,"context_line":"                # placement for this compute node"},{"line_number":246,"context_line":"                self.placementclient.delete_resource_provider("},{"line_number":247,"context_line":"                    context, service.compute_node, cascade\u003dTrue)"},{"line_number":248,"context_line":"                # remove the host_mapping of this host."},{"line_number":249,"context_line":"                try:"},{"line_number":250,"context_line":"                    hm \u003d objects.HostMapping.get_by_host(context, service.host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0eb751d3","line":247,"range":{"start_line":247,"start_character":29,"end_line":247,"end_character":49},"updated":"2018-12-07 13:14:29.000000000","message":"Yet another location where the service and compute node concept is being equated. :( They are not the same. There can be thousands of compute node records (and thus, resource provider records) associated with a single nova-compute service when Ironic is in use. This code is just flat-out buggy for Ironic...","commit_id":"c6380461f02b1a95551f26d27fd0af21f4bbb721"}],"nova/compute/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"904c57183cfb7438f582a3d590582f993d87d387","unresolved":false,"context_lines":[{"line_number":2131,"context_line":"            if \u0027id\u0027 in bdm:"},{"line_number":2132,"context_line":"                bdm.destroy()"},{"line_number":2133,"context_line":""},{"line_number":2134,"context_line":"    def _get_placement_client(self):"},{"line_number":2135,"context_line":"        if self.placementclient is None:"},{"line_number":2136,"context_line":"            self.placementclient \u003d reportclient.SchedulerReportClient()"},{"line_number":2137,"context_line":"        return self.placementclient"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_374b8e5d","line":2134,"updated":"2018-12-06 18:53:16.000000000","message":"If you make this @property you can avoid having to change code below to call this method, and avoid future bugs where people forget to and assume this has already been called once by the time they need it.","commit_id":"6ac2b16d26cf1bb48bb44dcb74a55015cde00aa7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c46599e203c1614cf7645aa56f1b1b99680a2c41","unresolved":false,"context_lines":[{"line_number":2131,"context_line":"            if \u0027id\u0027 in bdm:"},{"line_number":2132,"context_line":"                bdm.destroy()"},{"line_number":2133,"context_line":""},{"line_number":2134,"context_line":"    def _get_placement_client(self):"},{"line_number":2135,"context_line":"        if self.placementclient is None:"},{"line_number":2136,"context_line":"            self.placementclient \u003d reportclient.SchedulerReportClient()"},{"line_number":2137,"context_line":"        return self.placementclient"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d73b3ac3","line":2134,"in_reply_to":"3f79a3b5_374b8e5d","updated":"2018-12-06 18:54:56.000000000","message":"Good point, will change.","commit_id":"6ac2b16d26cf1bb48bb44dcb74a55015cde00aa7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9b8b38ceb4186f0b123dfe8ad173c3136cf594e7","unresolved":false,"context_lines":[{"line_number":5318,"context_line":"    \"\"\"Sub-set of the Compute Manager API for managing host aggregates.\"\"\""},{"line_number":5319,"context_line":"    def __init__(self, **kwargs):"},{"line_number":5320,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":5321,"context_line":"        self.scheduler_client \u003d scheduler_client.SchedulerClient()"},{"line_number":5322,"context_line":"        self.placement_client \u003d None  # Loaded in _get_placement_client()."},{"line_number":5323,"context_line":"        super(AggregateAPI, self).__init__(**kwargs)"},{"line_number":5324,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_77ca66a3","line":5321,"range":{"start_line":5321,"start_character":8,"end_line":5321,"end_character":66},"updated":"2018-12-06 19:03:02.000000000","message":"This also creates a SchedulerReportClient so the change below doesn\u0027t help us:\n\nhttps://github.com/openstack/nova/blob/c9dca64fa64005e5bea327f06a7a3f4821ab72b1/nova/scheduler/client/__init__.py#L25","commit_id":"6ac2b16d26cf1bb48bb44dcb74a55015cde00aa7"}]}
