)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"5495a53c7ec7188979e5c5299e30c4317638a6ff","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Concerns that make this not fully ready:"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"* What\u0027s the proper interval and should it be configurable (let\u0027s hope"},{"line_number":36,"context_line":"  not)? 60 seconds is presumably too short."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"* Does manipulation of the aggregate_refresh_map need to be"},{"line_number":39,"context_line":"  synchronized? Accessing the dict itself is thread safe, but...?"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df3967d1_e28da231","line":36,"range":{"start_line":35,"start_character":0,"end_line":36,"end_character":43},"updated":"2017-08-02 13:05:50.000000000","message":"Maybe some operators would have a better idea, but if the actual creation/deletion of aggs does an update to the map, we could probably go a lot longer, just to rectify when things do get out of whack. We should definitely log the hell out of such cases, so ops have an idea how to adjust this interval.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3e742e42d70b270699c9270a052e75276db89ceb","unresolved":false,"context_lines":[{"line_number":33,"context_line":"Concerns that make this not fully ready:"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"* What\u0027s the proper interval and should it be configurable (let\u0027s hope"},{"line_number":36,"context_line":"  not)? 60 seconds is presumably too short."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"* Does manipulation of the aggregate_refresh_map need to be"},{"line_number":39,"context_line":"  synchronized? Accessing the dict itself is thread safe, but...?"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df3967d1_ed091395","line":36,"in_reply_to":"df3967d1_e28da231","updated":"2017-08-02 13:36:39.000000000","message":"I\u0027m not sure I\u0027m parsing you when you say \"if the actual creation/deletion of aggs does an update\".\n\nThe resource tracker has no knowledge of when aggs are created, which is why it is polling to find out about them, so my question is \"what is a reasonable polling interval\".","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"aa27be2fe9a2a01144816be943dbbd3fb199653b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"Concerns that make this not fully ready:"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"* What\u0027s the proper interval and should it be configurable (let\u0027s hope"},{"line_number":36,"context_line":"  not)? 60 seconds is presumably too short."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"* Does manipulation of the aggregate_refresh_map need to be"},{"line_number":39,"context_line":"  synchronized? Accessing the dict itself is thread safe, but...?"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df3967d1_882835e2","line":36,"in_reply_to":"df3967d1_ed091395","updated":"2017-08-02 14:02:46.000000000","message":"As explained on IRC, I need more coffee before writing stuff.\n\nI was thinking that if we created a way to set placement aggs through Nova, then it could be called through the report client, and those calls could force an update of the agg map. Then the period between refresh calls could be longer, since we should have already accounted for most changes.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9851045c60a638f47f44f41646879a808c75e038","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Update RT aggregate map less frequently"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The _provider_aggregate_map was being updated every time"},{"line_number":10,"context_line":"_ensure_resource_provider was called. This is inefficient as aggregates"},{"line_number":11,"context_line":"are not updated that often."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This change only updates the aggregate map for any single resource"},{"line_number":14,"context_line":"provider if it has not been updated in the last 300 seconds. The"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7f515b1d_09128d0a","line":11,"range":{"start_line":10,"start_character":58,"end_line":11,"end_character":27},"updated":"2017-10-03 13:41:17.000000000","message":"that\u0027s an understatement :)","commit_id":"fc6caeeb5122ad4577ebd98f23309a68b8e9e738"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"5495a53c7ec7188979e5c5299e30c4317638a6ff","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":559,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":560,"context_line":"            LOG.debug(msg, rp_uuid)"},{"line_number":561,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":562,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":563,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_c2e73ee4","line":561,"updated":"2017-08-02 13:05:50.000000000","message":"I would store a copy of the original map, and then compare it to the one returned here. If they differ, log the difference and whether force\u003dFalse, indicating the stale cache was out of sync.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bb3968bd6a7edfabb275df20b775c6a797c31a60","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":559,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":560,"context_line":"            LOG.debug(msg, rp_uuid)"},{"line_number":561,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":562,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":563,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_e898e11b","line":561,"in_reply_to":"df3967d1_48c6cd4a","updated":"2017-08-02 14:08:37.000000000","message":"ah, I get ya, so one could see how many attempts to refresh actually resulted in a change.\n\nthat\u0027s probably useful even if it is not configurable, so I\u0027ll look into adding it anyway","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"aa27be2fe9a2a01144816be943dbbd3fb199653b","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":559,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":560,"context_line":"            LOG.debug(msg, rp_uuid)"},{"line_number":561,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":562,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":563,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_48c6cd4a","line":561,"in_reply_to":"df3967d1_6d3ac334","updated":"2017-08-02 14:02:46.000000000","message":"If there were a record of how often the agg map was incorrect and needed to be updated, an operator could use that information to set the refresh time (assuming, of course, that the interval for staleness is configurable).","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3e742e42d70b270699c9270a052e75276db89ceb","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":559,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":560,"context_line":"            LOG.debug(msg, rp_uuid)"},{"line_number":561,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":562,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":563,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":564,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_6d3ac334","line":561,"in_reply_to":"df3967d1_c2e73ee4","updated":"2017-08-02 13:36:39.000000000","message":"To what end? Who is going to use that information, for what?","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"5495a53c7ec7188979e5c5299e30c4317638a6ff","unresolved":false,"context_lines":[{"line_number":568,"context_line":"        It is old if _aggregrate_refresh_time is None or more than 60"},{"line_number":569,"context_line":"        seconds ago."},{"line_number":570,"context_line":"        \"\"\""},{"line_number":571,"context_line":"        refresh_time \u003d self.aggregate_refresh_time.get(uuid)"},{"line_number":572,"context_line":"        return (not refresh_time or time.time() - refresh_time \u003e 60)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _update_inventory_attempt(self, rp_uuid, inv_data):"},{"line_number":575,"context_line":"        \"\"\"Update the inventory for this resource provider if needed."}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_623ad234","line":572,"range":{"start_line":571,"start_character":0,"end_line":572,"end_character":68},"updated":"2017-08-02 13:05:50.000000000","message":"Simplified:\n\n        refresh_time \u003d self.aggregate_refresh_time.get(uuid, 0)\n        return (time.time() - refresh_time \u003e 60)\n\nAnd this should probably be tied to a config setting.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"aa27be2fe9a2a01144816be943dbbd3fb199653b","unresolved":false,"context_lines":[{"line_number":569,"context_line":"        seconds ago."},{"line_number":570,"context_line":"        \"\"\""},{"line_number":571,"context_line":"        refresh_time \u003d self.aggregate_refresh_time.get(uuid)"},{"line_number":572,"context_line":"        return (not refresh_time or time.time() - refresh_time \u003e 60)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _update_inventory_attempt(self, rp_uuid, inv_data):"},{"line_number":575,"context_line":"        \"\"\"Update the inventory for this resource provider if needed."}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_a803f972","line":572,"in_reply_to":"df3967d1_4d77ff03","updated":"2017-08-02 14:02:46.000000000","message":"Agreed, but if this is a performance issue, I\u0027m sure there will be a demand to tweak it.\n\nAt the very least, you should declare a constant at the top of the file with the interval. I\u0027m always wary of \"magic numbers\" in code.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3e742e42d70b270699c9270a052e75276db89ceb","unresolved":false,"context_lines":[{"line_number":569,"context_line":"        seconds ago."},{"line_number":570,"context_line":"        \"\"\""},{"line_number":571,"context_line":"        refresh_time \u003d self.aggregate_refresh_time.get(uuid)"},{"line_number":572,"context_line":"        return (not refresh_time or time.time() - refresh_time \u003e 60)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _update_inventory_attempt(self, rp_uuid, inv_data):"},{"line_number":575,"context_line":"        \"\"\"Update the inventory for this resource provider if needed."}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_4d77ff03","line":572,"in_reply_to":"df3967d1_623ad234","updated":"2017-08-02 13:36:39.000000000","message":"Thanks, that is better.\n\nI\u0027d really like to avoid a config setting if we can do so, unless we have one that exist already that we can use. There are just too many of them.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"bb3968bd6a7edfabb275df20b775c6a797c31a60","unresolved":false,"context_lines":[{"line_number":569,"context_line":"        seconds ago."},{"line_number":570,"context_line":"        \"\"\""},{"line_number":571,"context_line":"        refresh_time \u003d self.aggregate_refresh_time.get(uuid)"},{"line_number":572,"context_line":"        return (not refresh_time or time.time() - refresh_time \u003e 60)"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _update_inventory_attempt(self, rp_uuid, inv_data):"},{"line_number":575,"context_line":"        \"\"\"Update the inventory for this resource provider if needed."}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_68d631c6","line":572,"in_reply_to":"df3967d1_a803f972","updated":"2017-08-02 14:08:37.000000000","message":"yeah, agree about setting a constant. I was waiting for the conf/not-conf discussion to resolve before doing that.","commit_id":"eae150c58d0647b2b795a0fdc02b9c38a28ef98b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6f1c1a47a11140d714691f34fa909250ad53c28c","unresolved":false,"context_lines":[{"line_number":555,"context_line":"        \"\"\"Refresh the aggregate map for the provider resoruce provider uuid."},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"        Only refresh if there has been no refresh during the lifetime of"},{"line_number":558,"context_line":"        this process or 60 seconds have passed."},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":561,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_4686fa15","line":558,"range":{"start_line":558,"start_character":24,"end_line":558,"end_character":26},"updated":"2017-09-04 13:27:31.000000000","message":"nit: isn\u0027t it 300 seconds due to the value of AGGREGATE_REFRESH ?","commit_id":"7ab0229ae8c9c38f206bd670e2f8f8322ae595f3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3e29f6c35a75b0a22809a30b98151d8412400950","unresolved":false,"context_lines":[{"line_number":555,"context_line":"        \"\"\"Refresh the aggregate map for the provider resoruce provider uuid."},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"        Only refresh if there has been no refresh during the lifetime of"},{"line_number":558,"context_line":"        this process or 60 seconds have passed."},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":561,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_fa90d997","line":558,"in_reply_to":"7f287b81_4686fa15","updated":"2017-09-04 15:50:33.000000000","message":"yup, that never got fixed up, thanks","commit_id":"7ab0229ae8c9c38f206bd670e2f8f8322ae595f3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6f1c1a47a11140d714691f34fa909250ad53c28c","unresolved":false,"context_lines":[{"line_number":557,"context_line":"        Only refresh if there has been no refresh during the lifetime of"},{"line_number":558,"context_line":"        this process or 60 seconds have passed."},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":561,"context_line":"        \"\"\""},{"line_number":562,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":563,"context_line":"            original_aggs \u003d self._provider_aggregate_map.get(rp_uuid, [])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_469b9a65","line":560,"updated":"2017-09-04 13:27:31.000000000","message":"There is a force flag to refresh the map as well but that is not documented","commit_id":"7ab0229ae8c9c38f206bd670e2f8f8322ae595f3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3e29f6c35a75b0a22809a30b98151d8412400950","unresolved":false,"context_lines":[{"line_number":557,"context_line":"        Only refresh if there has been no refresh during the lifetime of"},{"line_number":558,"context_line":"        this process or 60 seconds have passed."},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":561,"context_line":"        \"\"\""},{"line_number":562,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":563,"context_line":"            original_aggs \u003d self._provider_aggregate_map.get(rp_uuid, [])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_da8bdd65","line":560,"in_reply_to":"7f287b81_469b9a65","updated":"2017-09-04 15:50:33.000000000","message":"good eye","commit_id":"7ab0229ae8c9c38f206bd670e2f8f8322ae595f3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        this process, AGGREGATE_REFRESH seconds have passed, or the force arg"},{"line_number":559,"context_line":"        has been set to True."},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":562,"context_line":"        :param force: If True, force the refresh"},{"line_number":563,"context_line":"        \"\"\""},{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_59a62511","line":561,"range":{"start_line":561,"start_character":66,"end_line":561,"end_character":79},"updated":"2017-10-02 20:47:43.000000000","message":"copy/paste","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        this process, AGGREGATE_REFRESH seconds have passed, or the force arg"},{"line_number":559,"context_line":"        has been set to True."},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":562,"context_line":"        :param force: If True, force the refresh"},{"line_number":563,"context_line":"        \"\"\""},{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_39b12948","line":561,"range":{"start_line":561,"start_character":26,"end_line":561,"end_character":36},"updated":"2017-10-02 20:47:43.000000000","message":"redundant","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cd9acb10bdb9a722f15c481c9e8b7ce7d355da57","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        this process, AGGREGATE_REFRESH seconds have passed, or the force arg"},{"line_number":559,"context_line":"        has been set to True."},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":562,"context_line":"        :param force: If True, force the refresh"},{"line_number":563,"context_line":"        \"\"\""},{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_5cd84851","line":561,"range":{"start_line":561,"start_character":26,"end_line":561,"end_character":36},"in_reply_to":"7f515b1d_39b12948","updated":"2017-10-03 11:50:33.000000000","message":"Done","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cd9acb10bdb9a722f15c481c9e8b7ce7d355da57","unresolved":false,"context_lines":[{"line_number":558,"context_line":"        this process, AGGREGATE_REFRESH seconds have passed, or the force arg"},{"line_number":559,"context_line":"        has been set to True."},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"        :param uuid: UUID identifier for the resource provider to ensure exists"},{"line_number":562,"context_line":"        :param force: If True, force the refresh"},{"line_number":563,"context_line":"        \"\"\""},{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_3cdb4c4f","line":561,"range":{"start_line":561,"start_character":66,"end_line":561,"end_character":79},"in_reply_to":"7f515b1d_59a62511","updated":"2017-10-03 11:50:33.000000000","message":"Done","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":562,"context_line":"        :param force: If True, force the refresh"},{"line_number":563,"context_line":"        \"\"\""},{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":565,"context_line":"            original_aggs \u003d self._provider_aggregate_map.get(rp_uuid, [])"},{"line_number":566,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":567,"context_line":"            diff_aggs \u003d set(original_aggs) - set(aggs)"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_59298534","line":565,"range":{"start_line":565,"start_character":12,"end_line":565,"end_character":73},"updated":"2017-10-02 20:47:43.000000000","message":"It should be logically equivalent, because you\u0027re always populating the map the first time, but it would be clearer (your posterity would have to read less code to understand its correctness) to do this above - without the defaulting - and include it in the condition.\n\n original_aggs \u003d self._provider_aggregate_map.get(rp_uuid)\n if force or original_aggs is None or stale...:","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"41600fee2ddf2306f286c7b02e309a22d86230bb","unresolved":false,"context_lines":[{"line_number":562,"context_line":"        :param force: If True, force the refresh"},{"line_number":563,"context_line":"        \"\"\""},{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":565,"context_line":"            original_aggs \u003d self._provider_aggregate_map.get(rp_uuid, [])"},{"line_number":566,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":567,"context_line":"            diff_aggs \u003d set(original_aggs) - set(aggs)"},{"line_number":568,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_7c4f846a","line":565,"range":{"start_line":565,"start_character":12,"end_line":565,"end_character":73},"in_reply_to":"7f515b1d_59298534","updated":"2017-10-03 11:14:11.000000000","message":"The intent here was to avoid looking at the aggregate map dict if we had no reason to do so. We also want the default for the set handling below.","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":565,"context_line":"            original_aggs \u003d self._provider_aggregate_map.get(rp_uuid, [])"},{"line_number":566,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":567,"context_line":"            diff_aggs \u003d set(original_aggs) - set(aggs)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"            msg \u003d (\"Refreshing aggregate associations for resource \""},{"line_number":570,"context_line":"                   \"provider %s, changes: %s\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_d98a1562","line":567,"range":{"start_line":567,"start_character":43,"end_line":567,"end_character":44},"updated":"2017-10-02 20:47:43.000000000","message":"This should be ^\n\nE.g. {1, 2} - {1, 2, 3} \u003d {}\nbut  {1, 2} ^ {1, 2, 3} \u003d {3} which is what you want.","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"41600fee2ddf2306f286c7b02e309a22d86230bb","unresolved":false,"context_lines":[{"line_number":564,"context_line":"        if force or self._aggregate_map_stale(rp_uuid):"},{"line_number":565,"context_line":"            original_aggs \u003d self._provider_aggregate_map.get(rp_uuid, [])"},{"line_number":566,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":567,"context_line":"            diff_aggs \u003d set(original_aggs) - set(aggs)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"            msg \u003d (\"Refreshing aggregate associations for resource \""},{"line_number":570,"context_line":"                   \"provider %s, changes: %s\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_5c2de892","line":567,"range":{"start_line":567,"start_character":43,"end_line":567,"end_character":44},"in_reply_to":"7f515b1d_d98a1562","updated":"2017-10-03 11:14:11.000000000","message":"I must be missing a test, will poke.","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cd9acb10bdb9a722f15c481c9e8b7ce7d355da57","unresolved":false,"context_lines":[{"line_number":568,"context_line":""},{"line_number":569,"context_line":"            msg \u003d (\"Refreshing aggregate associations for resource \""},{"line_number":570,"context_line":"                   \"provider %s, changes: %s\")"},{"line_number":571,"context_line":"            LOG.debug(msg, rp_uuid, \u0027,\u0027.join(diff_aggs or [\u0027None\u0027]))"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":574,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_9ca5a0a1","line":571,"updated":"2017-10-03 11:50:33.000000000","message":"Actually, I reckon if I change this message to something actually meaningful we can make things much simpler.","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":566,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":567,"context_line":"            diff_aggs \u003d set(original_aggs) - set(aggs)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"            msg \u003d (\"Refreshing aggregate associations for resource \""},{"line_number":570,"context_line":"                   \"provider %s, changes: %s\")"},{"line_number":571,"context_line":"            LOG.debug(msg, rp_uuid, \u0027,\u0027.join(diff_aggs or [\u0027None\u0027]))"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":574,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    def _aggregate_map_stale(self, uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_59106500","line":573,"range":{"start_line":569,"start_character":0,"end_line":573,"end_character":56},"updated":"2017-10-02 20:47:43.000000000","message":"Why not condition this bit on whether the aggs have changed?","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"41600fee2ddf2306f286c7b02e309a22d86230bb","unresolved":false,"context_lines":[{"line_number":566,"context_line":"            aggs \u003d self._get_provider_aggregates(rp_uuid)"},{"line_number":567,"context_line":"            diff_aggs \u003d set(original_aggs) - set(aggs)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"            msg \u003d (\"Refreshing aggregate associations for resource \""},{"line_number":570,"context_line":"                   \"provider %s, changes: %s\")"},{"line_number":571,"context_line":"            LOG.debug(msg, rp_uuid, \u0027,\u0027.join(diff_aggs or [\u0027None\u0027]))"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":574,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    def _aggregate_map_stale(self, uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_1c58902e","line":573,"range":{"start_line":569,"start_character":0,"end_line":573,"end_character":56},"in_reply_to":"7f515b1d_59106500","updated":"2017-10-03 11:14:11.000000000","message":"Because it doesn\u0027t matter? We\u0027ve already declared we\u0027re going to refresh them (whether because we\u0027ve said force or otherwise), so may as well just set them, even if they are the same.","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":571,"context_line":"            LOG.debug(msg, rp_uuid, \u0027,\u0027.join(diff_aggs or [\u0027None\u0027]))"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":574,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    def _aggregate_map_stale(self, uuid):"},{"line_number":577,"context_line":"        \"\"\"Respond True if the _provider_aggregate_map is old."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_5942a510","line":574,"range":{"start_line":574,"start_character":51,"end_line":574,"end_character":62},"updated":"2017-10-02 20:47:43.000000000","message":"Doesn\u0027t *really* matter, but this time.time() won\u0027t be *exactly* the same as the one on L583.  Why does _aggregate_map_stale need to be a separate method anyway?  If you inline it above, you can use the same time.time() for both (and eliminate a 2-line method).","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"41600fee2ddf2306f286c7b02e309a22d86230bb","unresolved":false,"context_lines":[{"line_number":571,"context_line":"            LOG.debug(msg, rp_uuid, \u0027,\u0027.join(diff_aggs or [\u0027None\u0027]))"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":"            self._provider_aggregate_map[rp_uuid] \u003d aggs"},{"line_number":574,"context_line":"            self.aggregate_refresh_time[rp_uuid] \u003d time.time()"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"    def _aggregate_map_stale(self, uuid):"},{"line_number":577,"context_line":"        \"\"\"Respond True if the _provider_aggregate_map is old."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_fc149445","line":574,"range":{"start_line":574,"start_character":51,"end_line":574,"end_character":62},"in_reply_to":"7f515b1d_5942a510","updated":"2017-10-03 11:14:11.000000000","message":"As you discovered it was for the sake of testing, and anyway, if I had my way we\u0027d have far more two line methods, not less...","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        or more than AGGREGATE_REFRESH seconds ago."},{"line_number":581,"context_line":"        \"\"\""},{"line_number":582,"context_line":"        refresh_time \u003d self.aggregate_refresh_time.get(uuid, 0)"},{"line_number":583,"context_line":"        return (time.time() - refresh_time \u003e AGGREGATE_REFRESH)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"    def _update_inventory_attempt(self, rp_uuid, inv_data):"},{"line_number":586,"context_line":"        \"\"\"Update the inventory for this resource provider if needed."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_99a01df6","line":583,"range":{"start_line":583,"start_character":15,"end_line":583,"end_character":63},"updated":"2017-10-02 20:47:43.000000000","message":"Parens redundant.  (Though I wouldn\u0027t object to parens around the subtraction for clarity.)","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"41600fee2ddf2306f286c7b02e309a22d86230bb","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        or more than AGGREGATE_REFRESH seconds ago."},{"line_number":581,"context_line":"        \"\"\""},{"line_number":582,"context_line":"        refresh_time \u003d self.aggregate_refresh_time.get(uuid, 0)"},{"line_number":583,"context_line":"        return (time.time() - refresh_time \u003e AGGREGATE_REFRESH)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"    def _update_inventory_attempt(self, rp_uuid, inv_data):"},{"line_number":586,"context_line":"        \"\"\"Update the inventory for this resource provider if needed."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_fc42543d","line":583,"range":{"start_line":583,"start_character":15,"end_line":583,"end_character":63},"in_reply_to":"7f515b1d_99a01df6","updated":"2017-10-03 11:14:11.000000000","message":"I get totally anxious around boolean returns, but yeah, will tweak","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6f1c1a47a11140d714691f34fa909250ad53c28c","unresolved":false,"context_lines":[{"line_number":1385,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1386,"context_line":"                \u0027_aggregate_map_stale\u0027)"},{"line_number":1387,"context_line":"    def test_refresh_aggregate_map_not_stale(self, mock_stale, mock_get):"},{"line_number":1388,"context_line":"        \"\"\"Test that refresh aggregate map is called when the map is"},{"line_number":1389,"context_line":"        stale."},{"line_number":1390,"context_line":"        \"\"\""},{"line_number":1391,"context_line":"        mock_stale.return_value \u003d False"},{"line_number":1392,"context_line":"        uuid \u003d uuids.compute_node"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_86086291","line":1389,"range":{"start_line":1388,"start_character":53,"end_line":1389,"end_character":14},"updated":"2017-09-04 13:27:31.000000000","message":"Hm, this contradicts with the L1391 below.","commit_id":"7ab0229ae8c9c38f206bd670e2f8f8322ae595f3"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3e29f6c35a75b0a22809a30b98151d8412400950","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"                \u0027_aggregate_map_stale\u0027)"},{"line_number":1387,"context_line":"    def test_refresh_aggregate_map_not_stale(self, mock_stale, mock_get):"},{"line_number":1388,"context_line":"        \"\"\"Test that refresh aggregate map is called when the map is"},{"line_number":1389,"context_line":"        stale."},{"line_number":1390,"context_line":"        \"\"\""},{"line_number":1391,"context_line":"        mock_stale.return_value \u003d False"},{"line_number":1392,"context_line":"        uuid \u003d uuids.compute_node"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f287b81_7aa4e908","line":1389,"in_reply_to":"7f287b81_86086291","updated":"2017-09-04 15:50:33.000000000","message":"yeah, that\u0027s a pasto, good catch","commit_id":"7ab0229ae8c9c38f206bd670e2f8f8322ae595f3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"337239cc020c15ae02b313b418908d6bf4bcf8dd","unresolved":false,"context_lines":[{"line_number":1383,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1384,"context_line":"                \u0027_get_provider_aggregates\u0027)"},{"line_number":1385,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.\u0027"},{"line_number":1386,"context_line":"                \u0027_aggregate_map_stale\u0027)"},{"line_number":1387,"context_line":"    def test_refresh_aggregate_map_not_stale(self, mock_stale, mock_get):"},{"line_number":1388,"context_line":"        \"\"\"Test that refresh aggregate map is not called when the map is"},{"line_number":1389,"context_line":"        not stale."}],"source_content_type":"text/x-python","patch_set":4,"id":"7f515b1d_59b745f6","line":1386,"range":{"start_line":1386,"start_character":17,"end_line":1386,"end_character":37},"updated":"2017-10-02 20:47:43.000000000","message":"Oh, I guess you split this method out for testing purposes.  Mmph.","commit_id":"7c32c5a9d79f97373ea998e56260b1d61827ac3f"}]}
