)]}'
{"nova/cmd/manage.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":1813,"context_line":"        try:"},{"line_number":1814,"context_line":"            allocations \u003d placement.get_allocs_for_consumer("},{"line_number":1815,"context_line":"                ctxt, instance.uuid)"},{"line_number":1816,"context_line":"        except (ks_exc.ClientException,"},{"line_number":1817,"context_line":"                exception.ConsumerAllocationRetrievalFailed) as e:"},{"line_number":1818,"context_line":"            output(_(\"Allocation retrieval failed: %s\") % e)"},{"line_number":1819,"context_line":"            # TODO(mriedem): Fail fast here, since we can\u0027t talk to placement."},{"line_number":1820,"context_line":"            allocations \u003d None"},{"line_number":1821,"context_line":""},{"line_number":1822,"context_line":"        # get_allocations_for_consumer uses safe_connect which will"},{"line_number":1823,"context_line":"        # return None if we can\u0027t communicate with Placement, and the"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_d664604b","line":1820,"range":{"start_line":1816,"start_character":0,"end_line":1820,"end_character":30},"updated":"2018-09-20 18:42:21.000000000","message":"Need to rebase to pick up [1].\n\n[1] https://github.com/openstack/nova/blame/adb1b788a264bae21671960cb4b5d919644efcbb/nova/cmd/manage.py#L1817","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":1813,"context_line":"        try:"},{"line_number":1814,"context_line":"            allocations \u003d placement.get_allocs_for_consumer("},{"line_number":1815,"context_line":"                ctxt, instance.uuid)"},{"line_number":1816,"context_line":"        except (ks_exc.ClientException,"},{"line_number":1817,"context_line":"                exception.ConsumerAllocationRetrievalFailed) as e:"},{"line_number":1818,"context_line":"            output(_(\"Allocation retrieval failed: %s\") % e)"},{"line_number":1819,"context_line":"            # TODO(mriedem): Fail fast here, since we can\u0027t talk to placement."},{"line_number":1820,"context_line":"            allocations \u003d None"},{"line_number":1821,"context_line":""},{"line_number":1822,"context_line":"        # get_allocations_for_consumer uses safe_connect which will"},{"line_number":1823,"context_line":"        # return None if we can\u0027t communicate with Placement, and the"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_d16c5834","line":1820,"range":{"start_line":1816,"start_character":0,"end_line":1820,"end_character":30},"in_reply_to":"3f79a3b5_d664604b","updated":"2018-09-21 13:47:18.000000000","message":"Sure I can do a rebase","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":1872,"context_line":"        if placement.put_allocations("},{"line_number":1873,"context_line":"                ctxt, node_uuid, instance.uuid, resources,"},{"line_number":1874,"context_line":"                instance.project_id, instance.user_id,"},{"line_number":1875,"context_line":"                consumer_generation\u003dNone):"},{"line_number":1876,"context_line":"            output(_(\u0027Successfully created allocations for \u0027"},{"line_number":1877,"context_line":"                     \u0027instance %(instance)s against resource \u0027"},{"line_number":1878,"context_line":"                     \u0027provider %(provider)s.\u0027) %"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_f0f2729b","line":1875,"range":{"start_line":1875,"start_character":16,"end_line":1875,"end_character":40},"updated":"2018-09-25 15:33:48.000000000","message":"OK so in this case this is correct because this instance doesn\u0027t yet have any allocations, unlike the case above on L1852 where the instance has allocations but the wrong consumer project_id/user_id.","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"}],"nova/exception.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"40b1a1033a5aae18844f35e8f08c4f48944cf2f3","unresolved":false,"context_lines":[{"line_number":2312,"context_line":""},{"line_number":2313,"context_line":""},{"line_number":2314,"context_line":"class AllocationUpdateFailed(NovaException):"},{"line_number":2315,"context_line":"    msg_fmt \u003d _(\u0027Failed to update allocations for consumer %(consumer_uuid)s. \u0027"},{"line_number":2316,"context_line":"                \u0027Error: %(error)s\u0027)"},{"line_number":2317,"context_line":""},{"line_number":2318,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_f075e432","line":2315,"updated":"2018-08-15 13:05:15.000000000","message":"Is there ever a case in _nova_ where allocations will not be updated by instance?","commit_id":"f84dea389e84ecdbb3e2522dc1106b064035cbe3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"43ccb0c68c5f388ed6feb6535de7095eb676ed57","unresolved":false,"context_lines":[{"line_number":2312,"context_line":""},{"line_number":2313,"context_line":""},{"line_number":2314,"context_line":"class AllocationUpdateFailed(NovaException):"},{"line_number":2315,"context_line":"    msg_fmt \u003d _(\u0027Failed to update allocations for consumer %(consumer_uuid)s. \u0027"},{"line_number":2316,"context_line":"                \u0027Error: %(error)s\u0027)"},{"line_number":2317,"context_line":""},{"line_number":2318,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a7b9d479","line":2315,"in_reply_to":"3f79a3b5_f075e432","updated":"2018-08-22 13:38:03.000000000","message":"Good point. At some point this was used with migration_uuid but I don\u0027t see that usage anymore. So I will revert this back to original","commit_id":"f84dea389e84ecdbb3e2522dc1106b064035cbe3"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"40b1a1033a5aae18844f35e8f08c4f48944cf2f3","unresolved":false,"context_lines":[{"line_number":1921,"context_line":"                # this is not a consumer generation conflict so it can only be"},{"line_number":1922,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":1923,"context_line":"                # provide resource provider generation so this is just a"},{"line_number":1924,"context_line":"                # placement internal race. We can blindly retry locally."},{"line_number":1925,"context_line":"                reason \u003d (\u0027another process changed the resource providers \u0027"},{"line_number":1926,"context_line":"                          \u0027involved in our attempt to put allocations for \u0027"},{"line_number":1927,"context_line":"                          \u0027consumer %s\u0027 % consumer_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_90b350e9","line":1924,"updated":"2018-08-15 13:05:15.000000000","message":"aside: hopefully with server side retries this will be very rare\n\nAlso code like this is a clear sign we need a change at: https://github.com/openstack/nova/blob/1bad99100a2cc9fc346d75aeac7e74b2a33b2dca/nova/api/openstack/placement/errors.py#L43\n\n(which was expected and planned)","commit_id":"f84dea389e84ecdbb3e2522dc1106b064035cbe3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"43ccb0c68c5f388ed6feb6535de7095eb676ed57","unresolved":false,"context_lines":[{"line_number":1921,"context_line":"                # this is not a consumer generation conflict so it can only be"},{"line_number":1922,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":1923,"context_line":"                # provide resource provider generation so this is just a"},{"line_number":1924,"context_line":"                # placement internal race. We can blindly retry locally."},{"line_number":1925,"context_line":"                reason \u003d (\u0027another process changed the resource providers \u0027"},{"line_number":1926,"context_line":"                          \u0027involved in our attempt to put allocations for \u0027"},{"line_number":1927,"context_line":"                          \u0027consumer %s\u0027 % consumer_uuid)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_8737f8fe","line":1924,"in_reply_to":"3f79a3b5_90b350e9","updated":"2018-08-22 13:38:03.000000000","message":"+1 for a separate error codes","commit_id":"f84dea389e84ecdbb3e2522dc1106b064035cbe3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":2018,"context_line":"                     \u0027text\u0027: r.text})"},{"line_number":2019,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":2020,"context_line":""},{"line_number":2021,"context_line":"    @safe_connect"},{"line_number":2022,"context_line":"    @retries"},{"line_number":2023,"context_line":"    def put_allocations(self, context, rp_uuid, consumer_uuid, alloc_data,"},{"line_number":2024,"context_line":"                        project_id, user_id, consumer_generation):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_043142ed","line":2021,"range":{"start_line":2021,"start_character":4,"end_line":2021,"end_character":17},"updated":"2018-09-20 18:42:21.000000000","message":"I would love it if we could whack @safe_connect while we\u0027re here. But I guess that can/should be a separate patch.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":2018,"context_line":"                     \u0027text\u0027: r.text})"},{"line_number":2019,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":2020,"context_line":""},{"line_number":2021,"context_line":"    @safe_connect"},{"line_number":2022,"context_line":"    @retries"},{"line_number":2023,"context_line":"    def put_allocations(self, context, rp_uuid, consumer_uuid, alloc_data,"},{"line_number":2024,"context_line":"                        project_id, user_id, consumer_generation):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_913020a0","line":2021,"range":{"start_line":2021,"start_character":4,"end_line":2021,"end_character":17},"in_reply_to":"3f79a3b5_043142ed","updated":"2018-09-21 13:47:18.000000000","message":"I made a note to myself to work on removing @safe_connect later in a separate patch.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":2058,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":2059,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2060,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2061,"context_line":"            if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2062,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":2063,"context_line":"                    consumer_uuid\u003dconsumer_uuid, error\u003dr.text)"},{"line_number":2064,"context_line":"            elif \u0027generation conflict\u0027 in r.text:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_99ca9b9d","line":2061,"range":{"start_line":2061,"start_character":15,"end_line":2061,"end_character":45},"updated":"2018-09-20 18:42:21.000000000","message":"We have error codes now, accessible via:\n\n r.json()[\u0027errors\u0027][0][\u0027code\u0027]\n\nUnfortunately, the tide went against me when I tried to insist on distinct codes for provider vs. consumer conflicts. I would love to get that fixed. Perhaps add a TODO here?\n\nBut if you like, you can also access the text via:\n\n r.json()[\u0027errors\u0027][0][\u0027detail\u0027]\n\n[Later] Oh, I see cdent made a similar comment in a prior patch set.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":2058,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":2059,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2060,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2061,"context_line":"            if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2062,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":2063,"context_line":"                    consumer_uuid\u003dconsumer_uuid, error\u003dr.text)"},{"line_number":2064,"context_line":"            elif \u0027generation conflict\u0027 in r.text:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_51128862","line":2061,"range":{"start_line":2061,"start_character":15,"end_line":2061,"end_character":45},"in_reply_to":"3f79a3b5_99ca9b9d","updated":"2018-09-21 13:47:18.000000000","message":"Done","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":2061,"context_line":"            if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2062,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":2063,"context_line":"                    consumer_uuid\u003dconsumer_uuid, error\u003dr.text)"},{"line_number":2064,"context_line":"            elif \u0027generation conflict\u0027 in r.text:"},{"line_number":2065,"context_line":"                # this is not a consumer generation conflict so it can only be"},{"line_number":2066,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":2067,"context_line":"                # provide resource provider generation so this is just a"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_19bc4bb3","line":2064,"range":{"start_line":2064,"start_character":17,"end_line":2064,"end_character":38},"updated":"2018-09-20 18:42:21.000000000","message":"Unless I totally managed to miss it, there\u0027s no API error containing the text \u0027generation conflict\u0027 other than the one you already caught above.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6067e1637e896e36107804596b2c92c2057025fd","unresolved":false,"context_lines":[{"line_number":2061,"context_line":"            if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2062,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":2063,"context_line":"                    consumer_uuid\u003dconsumer_uuid, error\u003dr.text)"},{"line_number":2064,"context_line":"            elif \u0027generation conflict\u0027 in r.text:"},{"line_number":2065,"context_line":"                # this is not a consumer generation conflict so it can only be"},{"line_number":2066,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":2067,"context_line":"                # provide resource provider generation so this is just a"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_829d2dbc","line":2064,"range":{"start_line":2064,"start_character":17,"end_line":2064,"end_character":38},"in_reply_to":"3f79a3b5_11cbb049","updated":"2018-09-21 15:44:03.000000000","message":"Only in the reshaper and inventory handlers, afaics. Are you seeing others?","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":2061,"context_line":"            if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2062,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":2063,"context_line":"                    consumer_uuid\u003dconsumer_uuid, error\u003dr.text)"},{"line_number":2064,"context_line":"            elif \u0027generation conflict\u0027 in r.text:"},{"line_number":2065,"context_line":"                # this is not a consumer generation conflict so it can only be"},{"line_number":2066,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":2067,"context_line":"                # provide resource provider generation so this is just a"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_11cbb049","line":2064,"range":{"start_line":2064,"start_character":17,"end_line":2064,"end_character":38},"in_reply_to":"3f79a3b5_19bc4bb3","updated":"2018-09-21 13:47:18.000000000","message":"There are HTTPConflict(_(\u0027resource provider generation conflict\u0027) exception in couple of places in the placement code. So I\u0027m not sure.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"1488533eb15a2ce03fb4f1f33d30667ebbd37a9d","unresolved":false,"context_lines":[{"line_number":2061,"context_line":"            if \u0027consumer generation conflict\u0027 in r.text:"},{"line_number":2062,"context_line":"                raise exception.AllocationUpdateFailed("},{"line_number":2063,"context_line":"                    consumer_uuid\u003dconsumer_uuid, error\u003dr.text)"},{"line_number":2064,"context_line":"            elif \u0027generation conflict\u0027 in r.text:"},{"line_number":2065,"context_line":"                # this is not a consumer generation conflict so it can only be"},{"line_number":2066,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":2067,"context_line":"                # provide resource provider generation so this is just a"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_13c85f1f","line":2064,"range":{"start_line":2064,"start_character":17,"end_line":2064,"end_character":38},"in_reply_to":"3f79a3b5_829d2dbc","updated":"2018-09-25 11:09:16.000000000","message":"True, those are the places I saw. You are correct that the allocation codepath in placement use a different message than the inventory and reshaper path:\n\"Inventory and/or allocations changed while attempting to allocate: %(error)s\"","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":2066,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":2067,"context_line":"                # provide resource provider generation so this is just a"},{"line_number":2068,"context_line":"                # placement internal race. We can blindly retry locally."},{"line_number":2069,"context_line":"                reason \u003d (\u0027another process changed the resource providers \u0027"},{"line_number":2070,"context_line":"                          \u0027involved in our attempt to put allocations for \u0027"},{"line_number":2071,"context_line":"                          \u0027consumer %s\u0027 % consumer_uuid)"},{"line_number":2072,"context_line":"                raise Retry(\u0027put_allocations\u0027, reason)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_045f020f","line":2069,"updated":"2018-09-20 18:42:21.000000000","message":"So yeah, in summary, I think the logic of this section (L2059-2079) should be more like:\n\n err \u003d r.json()[\u0027errors\u0027][0]\n if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:\n     # NOTE(gibi): Yes, it sucks doing string comparison like this, but we don\u0027t\n     # have separate error codes for consumer vs. provider generation conflicts\n     # TODO(gibi): Use more granular error codes when available\n     if \u0027consumer generation conflict\u0027 in err[\u0027detail\u0027]:\n         raise AllocationUpdateFailed(...)\n     # Excellent comment about internal race\n     raise Retry(...)\n # Non-conflict failure\n LOG.warning(...)","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":2066,"context_line":"                # a resource provider generation conflict. The caller does not"},{"line_number":2067,"context_line":"                # provide resource provider generation so this is just a"},{"line_number":2068,"context_line":"                # placement internal race. We can blindly retry locally."},{"line_number":2069,"context_line":"                reason \u003d (\u0027another process changed the resource providers \u0027"},{"line_number":2070,"context_line":"                          \u0027involved in our attempt to put allocations for \u0027"},{"line_number":2071,"context_line":"                          \u0027consumer %s\u0027 % consumer_uuid)"},{"line_number":2072,"context_line":"                raise Retry(\u0027put_allocations\u0027, reason)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_fc3a8bca","line":2069,"in_reply_to":"3f79a3b5_045f020f","updated":"2018-09-21 13:47:18.000000000","message":"Done","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9e284bb7c2cf513039da9ff6a010dbad33365aa6","unresolved":false,"context_lines":[{"line_number":2117,"context_line":"        if allocations[\u0027allocations\u0027] \u003d\u003d {}:"},{"line_number":2118,"context_line":"            # the consumer did not exist in the first place"},{"line_number":2119,"context_line":"            LOG.debug(\u0027Cannot delete allocation for %s consumer in placement \u0027"},{"line_number":2120,"context_line":"                      \u0027as consumer does not exists\u0027, uuid)"},{"line_number":2121,"context_line":"            return False"},{"line_number":2122,"context_line":""},{"line_number":2123,"context_line":"        # removing all resources from the allocation will auto delete the"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_c287a55a","line":2120,"range":{"start_line":2120,"start_character":44,"end_line":2120,"end_character":50},"updated":"2018-09-25 16:07:51.000000000","message":"exist","commit_id":"3a446a9da2f4dbbfefcde7ba49501961a6fbead3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":2009,"context_line":"                           consume."},{"line_number":2010,"context_line":"        :param project_id: The project_id associated with the allocations."},{"line_number":2011,"context_line":"        :param user_id: The user_id associated with the allocations."},{"line_number":2012,"context_line":"        :param consumer_generation: The current generation of the consumer"},{"line_number":2013,"context_line":"        :returns: True if the allocations were created, False otherwise."},{"line_number":2014,"context_line":"        :raises: Retry if the operation should be retried due to a concurrent"},{"line_number":2015,"context_line":"                 resource provider update."}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_10312e5a","line":2012,"updated":"2018-09-25 15:33:48.000000000","message":"nit: mention that callers can specify None if this is the initial allocation for the consumer.","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"144f20cca4f2d60864b56c7269a17ae1b145bc08","unresolved":false,"context_lines":[{"line_number":2009,"context_line":"                           consume."},{"line_number":2010,"context_line":"        :param project_id: The project_id associated with the allocations."},{"line_number":2011,"context_line":"        :param user_id: The user_id associated with the allocations."},{"line_number":2012,"context_line":"        :param consumer_generation: The current generation of the consumer"},{"line_number":2013,"context_line":"        :returns: True if the allocations were created, False otherwise."},{"line_number":2014,"context_line":"        :raises: Retry if the operation should be retried due to a concurrent"},{"line_number":2015,"context_line":"                 resource provider update."}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_8645dab6","line":2012,"in_reply_to":"3f79a3b5_10312e5a","updated":"2018-09-27 11:27:57.000000000","message":"done in the fup","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":2019,"context_line":""},{"line_number":2020,"context_line":"        payload \u003d {"},{"line_number":2021,"context_line":"            \u0027allocations\u0027: {"},{"line_number":2022,"context_line":"                    rp_uuid: {\u0027resources\u0027: alloc_data},"},{"line_number":2023,"context_line":"            },"},{"line_number":2024,"context_line":"            \u0027project_id\u0027: project_id,"},{"line_number":2025,"context_line":"            \u0027user_id\u0027: user_id,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_f037d24a","line":2022,"range":{"start_line":2022,"start_character":12,"end_line":2022,"end_character":20},"updated":"2018-09-25 15:33:48.000000000","message":"nit: alignment, drop one tab","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"144f20cca4f2d60864b56c7269a17ae1b145bc08","unresolved":false,"context_lines":[{"line_number":2019,"context_line":""},{"line_number":2020,"context_line":"        payload \u003d {"},{"line_number":2021,"context_line":"            \u0027allocations\u0027: {"},{"line_number":2022,"context_line":"                    rp_uuid: {\u0027resources\u0027: alloc_data},"},{"line_number":2023,"context_line":"            },"},{"line_number":2024,"context_line":"            \u0027project_id\u0027: project_id,"},{"line_number":2025,"context_line":"            \u0027user_id\u0027: user_id,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_461102af","line":2022,"range":{"start_line":2022,"start_character":12,"end_line":2022,"end_character":20},"in_reply_to":"3f79a3b5_f037d24a","updated":"2018-09-27 11:27:57.000000000","message":"done in the fup","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":2029,"context_line":"        r \u003d self.put(url, payload, version\u003dCONSUMER_GENERATION_VERSION,"},{"line_number":2030,"context_line":"                     global_request_id\u003dcontext.global_id)"},{"line_number":2031,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":2032,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"},{"line_number":2033,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2034,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2035,"context_line":"            # TODO(gibi): Use more granular error codes when available"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_107feedf","line":2032,"range":{"start_line":2032,"start_character":12,"end_line":2032,"end_character":39},"updated":"2018-09-25 15:33:48.000000000","message":"Hmm, is this error format in the response documented in the placement API reference? I guess https://docs.openstack.org/nova/latest/contributor/placement.html refers to http://specs.openstack.org/openstack/nova-specs/specs/rocky/implemented/placement-api-error-handling.html#rest-api-impact which means this would be implemented I guess, but I didn\u0027t think all APIs in placement had implemented this error response stuff yet?\n\nI guess in this case we\u0027re OK:\n\nhttps://github.com/openstack/nova/blob/43b25a81b490438d344512d6dd73be9b2e64b454/nova/api/openstack/placement/handlers/allocation.py#L464\n\nSince we don\u0027t microversion those error response changes it\u0027s possible we could hit an IndexError or KeyError here, but we also tell people to upgrade placement before nova, and those errors response changes went into rocky and this code is only for stein so we should be OK.","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9e284bb7c2cf513039da9ff6a010dbad33365aa6","unresolved":false,"context_lines":[{"line_number":2029,"context_line":"        r \u003d self.put(url, payload, version\u003dCONSUMER_GENERATION_VERSION,"},{"line_number":2030,"context_line":"                     global_request_id\u003dcontext.global_id)"},{"line_number":2031,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":2032,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"},{"line_number":2033,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2034,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2035,"context_line":"            # TODO(gibi): Use more granular error codes when available"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_33a0f442","line":2032,"range":{"start_line":2032,"start_character":12,"end_line":2032,"end_character":39},"in_reply_to":"3f79a3b5_107feedf","updated":"2018-09-25 16:07:51.000000000","message":"\u003e I didn\u0027t think\n \u003e all APIs in placement had implemented this error response stuff\n \u003e yet?\n\nYes, all error conditions get this as of 1.23; any we haven\u0027t specifically given a code get \u0027placement.undefined_code\u0027.\n\nhttps://github.com/openstack/nova/blob/43b25a81b490438d344512d6dd73be9b2e64b454/nova/api/openstack/placement/util.py#L134-L135\n \n \u003e Since we don\u0027t microversion those error response changes it\u0027s\n \u003e possible we could hit an IndexError or KeyError here, but we also\n \u003e tell people to upgrade placement before nova, and those errors\n \u003e response changes went into rocky and this code is only for stein so\n \u003e we should be OK.\n\nJust so.","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":2033,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2034,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2035,"context_line":"            # TODO(gibi): Use more granular error codes when available"},{"line_number":2036,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":2037,"context_line":"                if \u0027consumer generation conflict\u0027 in err[\u0027detail\u0027]:"},{"line_number":2038,"context_line":"                    raise exception.AllocationUpdateFailed("},{"line_number":2039,"context_line":"                        consumer_uuid\u003dconsumer_uuid, error\u003derr[\u0027detail\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_d08416b5","line":2036,"updated":"2018-09-25 15:33:48.000000000","message":"We should really probably document these in the API reference or in some Placement API guide, like the Compute API guide:\n\nhttps://developer.openstack.org/api-guide/compute/faults.html","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"144f20cca4f2d60864b56c7269a17ae1b145bc08","unresolved":false,"context_lines":[{"line_number":2033,"context_line":"            # NOTE(jaypipes): Yes, it sucks doing string comparison like this"},{"line_number":2034,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2035,"context_line":"            # TODO(gibi): Use more granular error codes when available"},{"line_number":2036,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":2037,"context_line":"                if \u0027consumer generation conflict\u0027 in err[\u0027detail\u0027]:"},{"line_number":2038,"context_line":"                    raise exception.AllocationUpdateFailed("},{"line_number":2039,"context_line":"                        consumer_uuid\u003dconsumer_uuid, error\u003derr[\u0027detail\u0027])"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_6662fe3f","line":2036,"in_reply_to":"3f79a3b5_d08416b5","updated":"2018-09-27 11:27:57.000000000","message":"Filed a bug not to forget it https://bugs.launchpad.net/nova/+bug/1794712","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":2034,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2035,"context_line":"            # TODO(gibi): Use more granular error codes when available"},{"line_number":2036,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":2037,"context_line":"                if \u0027consumer generation conflict\u0027 in err[\u0027detail\u0027]:"},{"line_number":2038,"context_line":"                    raise exception.AllocationUpdateFailed("},{"line_number":2039,"context_line":"                        consumer_uuid\u003dconsumer_uuid, error\u003derr[\u0027detail\u0027])"},{"line_number":2040,"context_line":"                # this is not a consumer generation conflict so it can only be"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_d02096b4","line":2037,"updated":"2018-09-25 15:33:48.000000000","message":"Hmm, where does this come from? In just looking at:\n\nhttps://github.com/openstack/nova/blob/43b25a81b490438d344512d6dd73be9b2e64b454/nova/api/openstack/placement/handlers/allocation.py#L460\n\nOh I guess it\u0027s raised directly from here:\n\nhttps://github.com/openstack/nova/blob/43b25a81b490438d344512d6dd73be9b2e64b454/nova/api/openstack/placement/util.py#L637\n\nI guess this is why you have the TODO above.","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"144f20cca4f2d60864b56c7269a17ae1b145bc08","unresolved":false,"context_lines":[{"line_number":2034,"context_line":"            # but we have no error codes, only error messages."},{"line_number":2035,"context_line":"            # TODO(gibi): Use more granular error codes when available"},{"line_number":2036,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":2037,"context_line":"                if \u0027consumer generation conflict\u0027 in err[\u0027detail\u0027]:"},{"line_number":2038,"context_line":"                    raise exception.AllocationUpdateFailed("},{"line_number":2039,"context_line":"                        consumer_uuid\u003dconsumer_uuid, error\u003derr[\u0027detail\u0027])"},{"line_number":2040,"context_line":"                # this is not a consumer generation conflict so it can only be"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_f4755434","line":2037,"in_reply_to":"3f79a3b5_d02096b4","updated":"2018-09-27 11:27:57.000000000","message":"exactly. I have a note on my desk to propose more granular error codes in placement.","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":4587,"context_line":"        # client that  might fail with a AllocationUpdateFailed exception if"},{"line_number":4588,"context_line":"        # the allocation modified in parallel."},{"line_number":4589,"context_line":""},{"line_number":4590,"context_line":"        # TODO(gibi): Can we drop this from Ironic now in Stein?"},{"line_number":4591,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_c427cab5","line":4590,"updated":"2018-09-20 18:42:21.000000000","message":"https://review.openstack.org/#/c/602481/ is merging, so I think we can kill this now.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":4587,"context_line":"        # client that  might fail with a AllocationUpdateFailed exception if"},{"line_number":4588,"context_line":"        # the allocation modified in parallel."},{"line_number":4589,"context_line":""},{"line_number":4590,"context_line":"        # TODO(gibi): Can we drop this from Ironic now in Stein?"},{"line_number":4591,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_9116e0a6","line":4590,"in_reply_to":"3f79a3b5_c427cab5","updated":"2018-09-21 13:47:18.000000000","message":"\\o/ Done","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"        failed \u003d mock.MagicMock()"},{"line_number":327,"context_line":"        failed.status_code \u003d 409"},{"line_number":328,"context_line":"        failed.text \u003d \"generation conflict\""},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"        succeeded \u003d mock.MagicMock()"},{"line_number":331,"context_line":"        succeeded.status_code \u003d 204"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_e42a067c","line":328,"range":{"start_line":328,"start_character":22,"end_line":328,"end_character":43},"updated":"2018-09-20 18:42:21.000000000","message":"as noted, not a realistic return","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"        failed \u003d mock.MagicMock()"},{"line_number":327,"context_line":"        failed.status_code \u003d 409"},{"line_number":328,"context_line":"        failed.text \u003d \"generation conflict\""},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"        succeeded \u003d mock.MagicMock()"},{"line_number":331,"context_line":"        succeeded.status_code \u003d 204"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_9cbef7d1","line":328,"range":{"start_line":328,"start_character":22,"end_line":328,"end_character":43},"in_reply_to":"3f79a3b5_e42a067c","updated":"2018-09-21 13:47:18.000000000","message":"I don\u0027t know what would be a realistic return but as I changed the code based on your suggestion I don\u0027t need to know it any more.","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"46f9844b070675f296ba893dd36632afd4fded75","unresolved":false,"context_lines":[{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        failed \u003d mock.MagicMock()"},{"line_number":353,"context_line":"        failed.status_code \u003d 409"},{"line_number":354,"context_line":"        failed.text \u003d \"generation conflict\""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"        mock_put.return_value \u003d failed"},{"line_number":357,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_841d5263","line":354,"range":{"start_line":354,"start_character":22,"end_line":354,"end_character":43},"updated":"2018-09-20 18:42:21.000000000","message":"ditto","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9832db1ff19605491c989224c7b4a5c569fd7dfc","unresolved":false,"context_lines":[{"line_number":351,"context_line":""},{"line_number":352,"context_line":"        failed \u003d mock.MagicMock()"},{"line_number":353,"context_line":"        failed.status_code \u003d 409"},{"line_number":354,"context_line":"        failed.text \u003d \"generation conflict\""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"        mock_put.return_value \u003d failed"},{"line_number":357,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_3ca6c3c1","line":354,"range":{"start_line":354,"start_character":22,"end_line":354,"end_character":43},"in_reply_to":"3f79a3b5_841d5263","updated":"2018-09-21 13:47:18.000000000","message":"Done","commit_id":"a9823fda0f3b2d81a6feef05f75a02968c3a0c5f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e2b94fa73f37a691966c4693e72ae313ba0dba01","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    @mock.patch.object(report.LOG, \u0027warning\u0027)"},{"line_number":302,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.put\u0027)"},{"line_number":303,"context_line":"    def test_put_allocations_fail_due_to_consumer_generation_conflict("},{"line_number":304,"context_line":"            self, mock_put, mock_warn):"},{"line_number":305,"context_line":"        mock_put.return_value \u003d fake_requests.FakeResponse("},{"line_number":306,"context_line":"            status_code\u003d409,"},{"line_number":307,"context_line":"            content\u003djsonutils.dumps("}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_73298c87","line":304,"range":{"start_line":304,"start_character":28,"end_line":304,"end_character":37},"updated":"2018-09-25 15:33:48.000000000","message":"This isn\u0027t used. Maybe you meant to check that it\u0027s not called? Or meant to put it on test_put_allocations_retries_conflict and assert it\u0027s called in that case?","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"144f20cca4f2d60864b56c7269a17ae1b145bc08","unresolved":false,"context_lines":[{"line_number":301,"context_line":"    @mock.patch.object(report.LOG, \u0027warning\u0027)"},{"line_number":302,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.put\u0027)"},{"line_number":303,"context_line":"    def test_put_allocations_fail_due_to_consumer_generation_conflict("},{"line_number":304,"context_line":"            self, mock_put, mock_warn):"},{"line_number":305,"context_line":"        mock_put.return_value \u003d fake_requests.FakeResponse("},{"line_number":306,"context_line":"            status_code\u003d409,"},{"line_number":307,"context_line":"            content\u003djsonutils.dumps("}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_74062488","line":304,"range":{"start_line":304,"start_character":28,"end_line":304,"end_character":37},"in_reply_to":"3f79a3b5_73298c87","updated":"2018-09-27 11:27:57.000000000","message":"I guess it is some rebase artifact as the warning only emitted for non 409 errors like in case of test_put_allocations_fail().\n\nI\u0027ve removed the unused mock in the fup","commit_id":"dfa2e6f221fbd4dd909da052805b0118da72f9a9"}]}
