)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1a45adb52dceea0cc988b9f9557bf50081f52e59","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Stephen Finucane \u003csfinucan@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-03-26 17:14:22 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[Stable Only] hardware: Handle races during pinning"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to how we do claiming of pinned CPUs and related NUMA \"things\", it\u0027s"},{"line_number":10,"context_line":"possible for claims to race. This raciness is usually not an issue since"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5fc1f717_353378ad","line":7,"updated":"2019-03-26 20:33:50.000000000","message":"The commit message doesn\u0027t explain why this is stable only. Does the code no longer exist on master?","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"f40f59e5684dfdaad3d0a416dfae3402d34fa6c6","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Stephen Finucane \u003csfinucan@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-03-26 17:14:22 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[Stable Only] hardware: Handle races during pinning"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to how we do claiming of pinned CPUs and related NUMA \"things\", it\u0027s"},{"line_number":10,"context_line":"possible for claims to race. This raciness is usually not an issue since"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5fc1f717_432e7c8c","line":7,"in_reply_to":"5fc1f717_353378ad","updated":"2019-03-27 12:29:54.000000000","message":"Done","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"2c98f283f7842a01cb7e0d6dd4dd4fc3881c1ea1","unresolved":false,"context_lines":[{"line_number":14,"context_line":"nasty bug made possible by Python\u0027s unusual scoping rules around for"},{"line_number":15,"context_line":"loops."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"    \u003e\u003e\u003e for x in range(5):"},{"line_number":18,"context_line":"    ...     pass"},{"line_number":19,"context_line":"    ..."},{"line_number":20,"context_line":"    \u003e\u003e\u003e print(x)"},{"line_number":21,"context_line":"    4"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"\u0027x\u0027 would be considered out of scope in the above for most other"},{"line_number":24,"context_line":"languages (JS and its even dumber scoping rules aside, I guess) and it"},{"line_number":25,"context_line":"leaves us with situations where the variable might never exist, i.e. the"},{"line_number":26,"context_line":"bug at hand:"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    \u003e\u003e\u003e for x in range(0):"},{"line_number":29,"context_line":"    ...     pass"},{"line_number":30,"context_line":"    ..."},{"line_number":31,"context_line":"    \u003e\u003e\u003e print(x)"},{"line_number":32,"context_line":"    Traceback (most recent call last):"},{"line_number":33,"context_line":"    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e"},{"line_number":34,"context_line":"    NameError: name \u0027x\u0027 is not defined"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Resolve this by adding a check to handle the \"no CPUs at all\" case and"},{"line_number":37,"context_line":"quick fail but also remove the reliance on this quirk of Python."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5fc1f717_ecfe8cad","line":34,"range":{"start_line":17,"start_character":0,"end_line":34,"end_character":38},"updated":"2019-03-27 00:03:31.000000000","message":"This is really a nit, but we don\u0027t need to know about Javascript\u0027s suckiness in the commit message, IMO.\n\nI\u0027d also make it more pertinent to the problem at hand by replacing the 5 and 0 in the range() with a variable, so something like:\n\n  \u003e\u003e\u003e y \u003d 5\n  \u003e\u003e\u003e for x in range(y):\n  ...   pass\n  ... \n  \u003e\u003e\u003e print(x)\n  4\n\n  \u003e\u003e\u003e y \u003d 0\n  \u003e\u003e\u003e for x in range(y):\n  ...   pass\n  ... \n  \u003e\u003e\u003e print(x)\n  Traceback (most recent call last):\n    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  NameError: name \u0027x\u0027 is not defined\n\n\nVery nice explanation, otherwise :)","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"f40f59e5684dfdaad3d0a416dfae3402d34fa6c6","unresolved":false,"context_lines":[{"line_number":14,"context_line":"nasty bug made possible by Python\u0027s unusual scoping rules around for"},{"line_number":15,"context_line":"loops."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"    \u003e\u003e\u003e for x in range(5):"},{"line_number":18,"context_line":"    ...     pass"},{"line_number":19,"context_line":"    ..."},{"line_number":20,"context_line":"    \u003e\u003e\u003e print(x)"},{"line_number":21,"context_line":"    4"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"\u0027x\u0027 would be considered out of scope in the above for most other"},{"line_number":24,"context_line":"languages (JS and its even dumber scoping rules aside, I guess) and it"},{"line_number":25,"context_line":"leaves us with situations where the variable might never exist, i.e. the"},{"line_number":26,"context_line":"bug at hand:"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    \u003e\u003e\u003e for x in range(0):"},{"line_number":29,"context_line":"    ...     pass"},{"line_number":30,"context_line":"    ..."},{"line_number":31,"context_line":"    \u003e\u003e\u003e print(x)"},{"line_number":32,"context_line":"    Traceback (most recent call last):"},{"line_number":33,"context_line":"    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e"},{"line_number":34,"context_line":"    NameError: name \u0027x\u0027 is not defined"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Resolve this by adding a check to handle the \"no CPUs at all\" case and"},{"line_number":37,"context_line":"quick fail but also remove the reliance on this quirk of Python."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5fc1f717_e34e886d","line":34,"range":{"start_line":17,"start_character":0,"end_line":34,"end_character":38},"in_reply_to":"5fc1f717_ecfe8cad","updated":"2019-03-27 12:29:54.000000000","message":"Done (partially, I want to have my fun too :))","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ab47fb0e31e13b2aa4e0f7c315092289d9a3d056","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Due to how we do claiming of pinned CPUs and related NUMA \"things\", it\u0027s"},{"line_number":10,"context_line":"possible for claims to race. This raciness is usually not an issue since"},{"line_number":11,"context_line":"pinning with fail for the losing instance, which will just get"},{"line_number":12,"context_line":"rescheduled. This does mean that it\u0027s possible for an instance to land"},{"line_number":13,"context_line":"on a host with no CPUs at all though and this edge case is triggering a"},{"line_number":14,"context_line":"nasty bug made possible by Python\u0027s unusual scoping rules around for"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5fc1f717_1d7ba8be","line":11,"range":{"start_line":11,"start_character":8,"end_line":11,"end_character":12},"updated":"2019-04-01 13:11:20.000000000","message":"will","commit_id":"50a0c6a4b98a3ef1d893b0bb204a4a4868017cbb"}],"nova/tests/unit/virt/test_hardware.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"2c98f283f7842a01cb7e0d6dd4dd4fc3881c1ea1","unresolved":false,"context_lines":[{"line_number":2408,"context_line":"        # This host has 8 cores but 2 of them are disabled via \u0027vcpu_pin_set\u0027,"},{"line_number":2409,"context_line":"        # meaning they have no thread siblings and aren\u0027t included in"},{"line_number":2410,"context_line":"        # \u0027siblings\u0027 below. This can break thread-aware checks, which assume a"},{"line_number":2411,"context_line":"        # sum(siblings) \u003d\u003d sum(cpus). This was resolved on master in commits"},{"line_number":2412,"context_line":"        # e344b3038aa and f200a4ad26 but those are quite chunky changes"},{"line_number":2413,"context_line":"        host_pin \u003d objects.NUMACell(id\u003d0, cpuset\u003dset([0, 1, 2, 3, 4, 6]),"},{"line_number":2414,"context_line":"                                    memory\u003d4096, memory_usage\u003d0,"},{"line_number":2415,"context_line":"                                    siblings\u003d[set([0, 1]), set([2, 3])],"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_7bd32f02","line":2412,"range":{"start_line":2411,"start_character":38,"end_line":2412,"end_character":71},"updated":"2019-03-27 00:03:31.000000000","message":"This should probably go in the commit message, as Matt pointed out.","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"f40f59e5684dfdaad3d0a416dfae3402d34fa6c6","unresolved":false,"context_lines":[{"line_number":2408,"context_line":"        # This host has 8 cores but 2 of them are disabled via \u0027vcpu_pin_set\u0027,"},{"line_number":2409,"context_line":"        # meaning they have no thread siblings and aren\u0027t included in"},{"line_number":2410,"context_line":"        # \u0027siblings\u0027 below. This can break thread-aware checks, which assume a"},{"line_number":2411,"context_line":"        # sum(siblings) \u003d\u003d sum(cpus). This was resolved on master in commits"},{"line_number":2412,"context_line":"        # e344b3038aa and f200a4ad26 but those are quite chunky changes"},{"line_number":2413,"context_line":"        host_pin \u003d objects.NUMACell(id\u003d0, cpuset\u003dset([0, 1, 2, 3, 4, 6]),"},{"line_number":2414,"context_line":"                                    memory\u003d4096, memory_usage\u003d0,"},{"line_number":2415,"context_line":"                                    siblings\u003d[set([0, 1]), set([2, 3])],"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_c3226ca3","line":2412,"range":{"start_line":2411,"start_character":38,"end_line":2412,"end_character":71},"in_reply_to":"5fc1f717_7bd32f02","updated":"2019-03-27 12:29:54.000000000","message":"Done","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"}],"nova/virt/hardware.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"2c98f283f7842a01cb7e0d6dd4dd4fc3881c1ea1","unresolved":false,"context_lines":[{"line_number":882,"context_line":"        if (instance_cell.cpu_thread_policy !\u003d"},{"line_number":883,"context_line":"                fields.CPUThreadAllocationPolicy.REQUIRE and"},{"line_number":884,"context_line":"                not pinning):"},{"line_number":885,"context_line":"            sibling_set \u003d sibling_sets[min(sibling_sets)]"},{"line_number":886,"context_line":"            pinning \u003d list(zip(sorted(instance_cell.cpuset),"},{"line_number":887,"context_line":"                               itertools.chain(*sibling_set)))"},{"line_number":888,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_5e574127","line":885,"updated":"2019-03-27 00:03:31.000000000","message":"This isn\u0027t strictly speaking necessary given the additions on L697-L705, but it is indeed much better to set it explicitly and rely on Python scoping quirk.","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"b1aee29d2bf6648839325a2c39735653940de7ef","unresolved":false,"context_lines":[{"line_number":882,"context_line":"        if (instance_cell.cpu_thread_policy !\u003d"},{"line_number":883,"context_line":"                fields.CPUThreadAllocationPolicy.REQUIRE and"},{"line_number":884,"context_line":"                not pinning):"},{"line_number":885,"context_line":"            sibling_set \u003d sibling_sets[min(sibling_sets)]"},{"line_number":886,"context_line":"            pinning \u003d list(zip(sorted(instance_cell.cpuset),"},{"line_number":887,"context_line":"                               itertools.chain(*sibling_set)))"},{"line_number":888,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_5e050113","line":885,"in_reply_to":"5fc1f717_5e574127","updated":"2019-03-27 00:04:11.000000000","message":"Err, and NOT rely","commit_id":"f6afbe5f47d1f9c98f121eef97eca1c313e85318"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"b4b6a275f1f4e16af6a33f6441e38c77c6a30780","unresolved":false,"context_lines":[{"line_number":855,"context_line":"        # NOTE(ndipanov): We iterate over the sibling sets in descending order"},{"line_number":856,"context_line":"        # of cores that can be packed. This is an attempt to evenly distribute"},{"line_number":857,"context_line":"        # instances among physical cores"},{"line_number":858,"context_line":"        for threads_no, sibling_set in sorted("},{"line_number":859,"context_line":"                (t for t in sibling_sets.items()), reverse\u003dTrue):"},{"line_number":860,"context_line":""},{"line_number":861,"context_line":"            # NOTE(sfinucan): The key difference between the require and"},{"line_number":862,"context_line":"            # prefer policies is that require will not settle for non-siblings"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_2ee9bfe1","line":859,"range":{"start_line":858,"start_character":0,"end_line":859,"end_character":65},"updated":"2019-03-28 12:40:18.000000000","message":"For future readers, the error occurs specifically because if sibling_sets is empty we never iterate over this loop and therefore sibling_set is undefined.","commit_id":"50a0c6a4b98a3ef1d893b0bb204a4a4868017cbb"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"b4b6a275f1f4e16af6a33f6441e38c77c6a30780","unresolved":false,"context_lines":[{"line_number":882,"context_line":"        if (instance_cell.cpu_thread_policy !\u003d"},{"line_number":883,"context_line":"                fields.CPUThreadAllocationPolicy.REQUIRE and"},{"line_number":884,"context_line":"                not pinning):"},{"line_number":885,"context_line":"            sibling_set \u003d sibling_sets[min(sibling_sets)]"},{"line_number":886,"context_line":"            pinning \u003d list(zip(sorted(instance_cell.cpuset),"},{"line_number":887,"context_line":"                               itertools.chain(*sibling_set)))"},{"line_number":888,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_6e002735","line":885,"updated":"2019-03-28 12:40:18.000000000","message":"Not strictly required now? Given that this is stable-only, I wonder if this is best left out, even though it\u0027s nicer. Merge conflicts, etc...","commit_id":"50a0c6a4b98a3ef1d893b0bb204a4a4868017cbb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"8f87f049b77cba013f034a1bbd4253416f6cb61b","unresolved":false,"context_lines":[{"line_number":882,"context_line":"        if (instance_cell.cpu_thread_policy !\u003d"},{"line_number":883,"context_line":"                fields.CPUThreadAllocationPolicy.REQUIRE and"},{"line_number":884,"context_line":"                not pinning):"},{"line_number":885,"context_line":"            sibling_set \u003d sibling_sets[min(sibling_sets)]"},{"line_number":886,"context_line":"            pinning \u003d list(zip(sorted(instance_cell.cpuset),"},{"line_number":887,"context_line":"                               itertools.chain(*sibling_set)))"},{"line_number":888,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_e7917e55","line":885,"in_reply_to":"5fc1f717_2599ddc2","updated":"2019-03-29 17:05:09.000000000","message":"I would leave it personally. It doesn\u0027t hurt anything, is more explicit, and if this code were to live in master,  might save someone during a refactor. Using the loop variable outside the loop is already pretty nasty, but many lines away like was the case here is especially heinous. A comment could explain this if it\u0027s really confusing, but it would venture to bet that the average reader wouldn\u0027t make the connection that it\u0027s redundant.","commit_id":"50a0c6a4b98a3ef1d893b0bb204a4a4868017cbb"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"17a2fa2c654a17ad40e7e19689236937e67740bc","unresolved":false,"context_lines":[{"line_number":882,"context_line":"        if (instance_cell.cpu_thread_policy !\u003d"},{"line_number":883,"context_line":"                fields.CPUThreadAllocationPolicy.REQUIRE and"},{"line_number":884,"context_line":"                not pinning):"},{"line_number":885,"context_line":"            sibling_set \u003d sibling_sets[min(sibling_sets)]"},{"line_number":886,"context_line":"            pinning \u003d list(zip(sorted(instance_cell.cpuset),"},{"line_number":887,"context_line":"                               itertools.chain(*sibling_set)))"},{"line_number":888,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_2599ddc2","line":885,"in_reply_to":"5fc1f717_6e002735","updated":"2019-03-28 13:35:53.000000000","message":"I\u0027m very much on the fence about this one myself. I might wait to see if anyone else thinks it should go and adjust if so","commit_id":"50a0c6a4b98a3ef1d893b0bb204a4a4868017cbb"}]}
