)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"66b7ae0761f9812978286d128241508ac3dd8c43","unresolved":false,"context_lines":[{"line_number":21,"context_line":"Then use min() to get the first AZ to handle."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Id57b4656337ab8f1bd2dc3e8bd679a23778a2dea"},{"line_number":24,"context_line":"Close-Bug: #1522677"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7a740942_9179baca","line":24,"updated":"2015-12-08 00:19:30.000000000","message":"Closes-Bug: #...","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"07b1c733504ad56e1fbf3fbdfea3f9a072e0cb0d","unresolved":false,"context_lines":[{"line_number":21,"context_line":"Then use min() to get the first AZ to handle."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Id57b4656337ab8f1bd2dc3e8bd679a23778a2dea"},{"line_number":24,"context_line":"Close-Bug: #1522677"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7a740942_b98e11ce","line":24,"in_reply_to":"7a740942_9179baca","updated":"2015-12-08 07:27:58.000000000","message":"Done","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"}],"neutron/scheduler/dhcp_agent_scheduler.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"17469742e32bf566a0e4630f58ce61696e43be5b","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        hostable_az_agents \u003d collections.defaultdict(list)"},{"line_number":110,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":111,"context_line":"        resource_hostable_agents \u003d sorted("},{"line_number":112,"context_line":"            resource_hostable_agents, key\u003dattrgetter(\u0027load\u0027))"},{"line_number":113,"context_line":"        for agent in resource_hostable_agents:"},{"line_number":114,"context_line":"            az_agent \u003d agent[\u0027availability_zone\u0027]"},{"line_number":115,"context_line":"            hostable_az_agents[az_agent].append(agent)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_00460bbf","line":112,"updated":"2015-12-07 02:43:14.000000000","message":"I noticed by Oda\u0027s comment. I guess that AZ weight logic should depend on BaseWeightScheduler because the weight logic may be changed in future. Therefore, it\u0027s better to use super(AZAwareWeightScheduler, self).select here.","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6e36ffddc5e1a239defe41a9cee35212abaebd55","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        hostable_az_agents \u003d collections.defaultdict(list)"},{"line_number":110,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":111,"context_line":"        resource_hostable_agents \u003d sorted("},{"line_number":112,"context_line":"            resource_hostable_agents, key\u003dattrgetter(\u0027load\u0027))"},{"line_number":113,"context_line":"        for agent in resource_hostable_agents:"},{"line_number":114,"context_line":"            az_agent \u003d agent[\u0027availability_zone\u0027]"},{"line_number":115,"context_line":"            hostable_az_agents[az_agent].append(agent)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_9807c81b","line":112,"in_reply_to":"7a740942_00460bbf","updated":"2015-12-07 10:37:34.000000000","message":"Done","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"394c104ea4ebdeb29cd987b10c9c614e6f2c4a30","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az, _ \u003d heapq.nsmallest("},{"line_number":128,"context_line":"                1, num_az_agents.items(), lambda t: t[1])[0]"},{"line_number":129,"context_line":"            select_agent \u003d super(AZAwareWeightScheduler, self).select("},{"line_number":130,"context_line":"                plugin, context, hostable_az_agents[select_az], [], 1)"},{"line_number":131,"context_line":"            chosen_agents.append(select_agent[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_656e0103","line":128,"updated":"2015-12-07 02:04:44.000000000","message":"I checked on heapq.nsmallest and found a description[1]. It seems to be better to use \"min(num_az_agents.items(), key\u003dlambda t: t[1])[0]\".\n\n[1]: https://docs.python.org/2.7/library/heapq.html#heapq.nsmallest","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"3194e9898427d44f11830f045dcaf52debdd9935","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az, _ \u003d heapq.nsmallest("},{"line_number":128,"context_line":"                1, num_az_agents.items(), lambda t: t[1])[0]"},{"line_number":129,"context_line":"            select_agent \u003d super(AZAwareWeightScheduler, self).select("},{"line_number":130,"context_line":"                plugin, context, hostable_az_agents[select_az], [], 1)"},{"line_number":131,"context_line":"            chosen_agents.append(select_agent[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_87ed2a27","line":128,"in_reply_to":"7a740942_656e0103","updated":"2015-12-07 08:14:37.000000000","message":"I am not very clear about your point, can you explain more in detail?","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"962360ecfcc5de0bbccce4a89b4deeae4e8fa0f6","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az, _ \u003d heapq.nsmallest("},{"line_number":128,"context_line":"                1, num_az_agents.items(), lambda t: t[1])[0]"},{"line_number":129,"context_line":"            select_agent \u003d super(AZAwareWeightScheduler, self).select("},{"line_number":130,"context_line":"                plugin, context, hostable_az_agents[select_az], [], 1)"},{"line_number":131,"context_line":"            chosen_agents.append(select_agent[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_92cebc2c","line":128,"in_reply_to":"7a740942_87ed2a27","updated":"2015-12-07 13:18:21.000000000","message":"I used heap so that we efficiently keep sorted list. Why do we need to use heap if we don\u0027t need to keep? I suppose that min() is faster than heap as long as we need just a sorted result.","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"244d15ff926a4980e51ab0e457336789becdabcb","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az, _ \u003d heapq.nsmallest("},{"line_number":128,"context_line":"                1, num_az_agents.items(), lambda t: t[1])[0]"},{"line_number":129,"context_line":"            select_agent \u003d super(AZAwareWeightScheduler, self).select("},{"line_number":130,"context_line":"                plugin, context, hostable_az_agents[select_az], [], 1)"},{"line_number":131,"context_line":"            chosen_agents.append(select_agent[0])"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_535db677","line":128,"in_reply_to":"7a740942_92cebc2c","updated":"2015-12-07 14:06:06.000000000","message":"Done","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":4149,"name":"Itsuro Oda","email":"oda@valinux.co.jp","username":"oda-g"},"change_message_id":"02f9d5eaceb50c330bb64e6f19a170474f58cdf2","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            select_az, _ \u003d heapq.nsmallest("},{"line_number":128,"context_line":"                1, num_az_agents.items(), lambda t: t[1])[0]"},{"line_number":129,"context_line":"            select_agent \u003d super(AZAwareWeightScheduler, self).select("},{"line_number":130,"context_line":"                plugin, context, hostable_az_agents[select_az], [], 1)"},{"line_number":131,"context_line":"            chosen_agents.append(select_agent[0])"},{"line_number":132,"context_line":"            hostable_az_agents[select_az].remove(select_agent[0])"},{"line_number":133,"context_line":"            if not hostable_az_agents[select_az]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_8510cda9","line":130,"updated":"2015-12-07 01:48:38.000000000","message":"hostable_az_agents is ordered by \u0027load\u0027 already. so, it can be\n\nselect_agent \u003d hostable_az_agents[select_az][0]\n\nchosen_agents.append(select_agent)\n\nhostable_az_agents[select_az].remove(select_agent)","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"6e36ffddc5e1a239defe41a9cee35212abaebd55","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            select_az, _ \u003d heapq.nsmallest("},{"line_number":128,"context_line":"                1, num_az_agents.items(), lambda t: t[1])[0]"},{"line_number":129,"context_line":"            select_agent \u003d super(AZAwareWeightScheduler, self).select("},{"line_number":130,"context_line":"                plugin, context, hostable_az_agents[select_az], [], 1)"},{"line_number":131,"context_line":"            chosen_agents.append(select_agent[0])"},{"line_number":132,"context_line":"            hostable_az_agents[select_az].remove(select_agent[0])"},{"line_number":133,"context_line":"            if not hostable_az_agents[select_az]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_53006101","line":130,"in_reply_to":"7a740942_8510cda9","updated":"2015-12-07 10:37:34.000000000","message":"Done","commit_id":"3f0915004f64a6ee324a4ade732d9f7354dbca63"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"66b7ae0761f9812978286d128241508ac3dd8c43","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_f1b6fef7","line":127,"updated":"2015-12-08 00:19:30.000000000","message":"use:\n\n key\u003doperator.itemgetter(1)\n\nWhat ensures num_az_agents is non-empty?\n\nIt implies many sorting, you could simply use the current implementation with:\n\n num_az_q \u003d [(value, random.random() , key) ...]","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ab4478c4c5f43150121ca528b0e309ffa7d5accd","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_d77ba126","line":127,"in_reply_to":"7a740942_796509b3","updated":"2015-12-08 09:12:13.000000000","message":"1) that\u0027s still the case, heapq orders elements using the 1st tuple value when distinct, the 2nd value is used to order when 1st value are equal so it shuffles agents with the same weight.\n\n2) i don\u0027t understand how proposed solution is more consistent","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"428470f2ab3b13af6474871dc518dafa775887cf","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_02ddbc0d","line":127,"in_reply_to":"7a740942_796509b3","updated":"2016-01-13 14:11:50.000000000","message":"\u003e\u003e 1) My first impression of AZAwareWeightScheduler, is that it is a Scheduler based on weight of agent.\n\n\nUsing:\n\n num_az_q \u003d [(value, random.random() , key) ...]\n\nin the heapq will return agent sorted first by weight then randomly, it ensures we select first agents with the highest weight and we select agents randomly when they have the same weight.","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"1858cc52bf52248a42bc17aeb13292bddc02425f","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_ebc802aa","line":127,"in_reply_to":"7a740942_d77ba126","updated":"2015-12-09 03:21:18.000000000","message":"From [1], if router only needs one agent, then line 388 in [1] will select the agent with least route weight.\n\nIf it is a ha router that needs multiple agents, then line 455 in [1] will sort agent according weight before scheduling.\n\nHope that can explain the effort here.\n\n[1] https://review.openstack.org/#/c/224418/31/neutron/scheduler/l3_agent_scheduler.py","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"428470f2ab3b13af6474871dc518dafa775887cf","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_22eec0ec","line":127,"in_reply_to":"7a740942_ebc802aa","updated":"2016-01-13 14:11:50.000000000","message":"I don\u0027t understand what you mean, i am still against performing a resort per iteration when we can use a heapq.","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"07b1c733504ad56e1fbf3fbdfea3f9a072e0cb0d","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_796509b3","line":127,"in_reply_to":"7a740942_f1b6fef7","updated":"2015-12-08 07:27:58.000000000","message":"num_az_agents is implicit non-empty here.\nline 127 will be called when num_agents_needed \u003e 0. However, num_agents_needed \u003e 0 implicitly means that len(resource_hostable_agents) \u003e0, according to line 243. And every agent will have AZ specified, so num_az_agents will not be empty here.\n\n\nUsing random is easier, but I don\u0027t think it is a better choice:\n\n\n1) My first impression of AZAwareWeightScheduler, is that it is a Scheduler based on weight of agent.\n2) It is not consistent with the implementation of router AZ, according to [1]\n\n[1] https://review.openstack.org/#/c/224418/31/neutron/scheduler/l3_agent_scheduler.py","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"812272fd1d3ff10368ecb17be6f8ea7c88884bcb","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        chosen_agents \u003d []"},{"line_number":126,"context_line":"        while num_agents_needed \u003e 0:"},{"line_number":127,"context_line":"            select_az \u003d min(num_az_agents.items(), key\u003dlambda t: t[1])[0]"},{"line_number":128,"context_line":"            select_agent \u003d hostable_az_agents[select_az][0]"},{"line_number":129,"context_line":"            chosen_agents.append(select_agent)"},{"line_number":130,"context_line":"            hostable_az_agents[select_az].remove(select_agent)"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_6c5a462c","line":127,"in_reply_to":"da6ed579_22eec0ec","updated":"2016-01-14 03:27:22.000000000","message":"num_az_q in original code is a list of (\"num of agents in AZ\", \"AZ name\"). It doesn\u0027t have weight information. Let\u0027s assume that num of agent in AZs are equal. If add random here, it will make the scheduler more like AZAwareChanceScheduler. \n\nWhy we need to resort at line 127 every time we want an agent? I think it is part of AZ implementation. If network needs multiple agents, AZAwareWeightScheduler will make sure the network is deployed evenly among AZs. So, we select the AZ that host the least instance of network(dhcp) everytime at line 127.\n\nComparing this patch and current code, I don\u0027t think compute load will increase(dramatically). This patch will do a general sort at line 109. The current code will sort in every AZ at line 127 in the left.","commit_id":"aede12c402427d45e7596e449a722e3b02923dc0"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"db57028735fc018ca84fca2418ddd1ced9d7972f","unresolved":false,"context_lines":[{"line_number":108,"context_line":"           - choose agent in the AZ with WeightScheduler"},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":"        hostable_az_agents \u003d collections.defaultdict(list)"},{"line_number":111,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":112,"context_line":"        resource_hostable_agents \u003d ("},{"line_number":113,"context_line":"            super(AZAwareWeightScheduler, self).select("},{"line_number":114,"context_line":"                plugin, context, resource_hostable_agents,"}],"source_content_type":"text/x-python","patch_set":7,"id":"dab17558_e2b79d82","line":111,"range":{"start_line":111,"start_character":36,"end_line":111,"end_character":47},"updated":"2016-05-12 02:40:51.000000000","message":"why did you make this an ordered dict?","commit_id":"01125bdd13272a34bb25126e6d26a27880ba0940"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"42a990d4ab5e51e2e49a5069d9edeac5d653b9b3","unresolved":false,"context_lines":[{"line_number":108,"context_line":"           - choose agent in the AZ with WeightScheduler"},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":"        hostable_az_agents \u003d collections.defaultdict(list)"},{"line_number":111,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":112,"context_line":"        resource_hostable_agents \u003d ("},{"line_number":113,"context_line":"            super(AZAwareWeightScheduler, self).select("},{"line_number":114,"context_line":"                plugin, context, resource_hostable_agents,"}],"source_content_type":"text/x-python","patch_set":7,"id":"dab17558_3a5a6051","line":111,"range":{"start_line":111,"start_character":36,"end_line":111,"end_character":47},"in_reply_to":"dab17558_e2b79d82","updated":"2016-05-12 09:36:50.000000000","message":"Thanks @YAMAMOTO to bring this question out. I will added some comments in next patch to eliminate such confusion.","commit_id":"01125bdd13272a34bb25126e6d26a27880ba0940"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a3c900bb34c536d1151d42c24fd2bfd3f521e554","unresolved":false,"context_lines":[{"line_number":104,"context_line":"           If the network has multiple AZs, agents are scheduled as"},{"line_number":105,"context_line":"           follows:"},{"line_number":106,"context_line":"           - select AZ with least agents scheduled for the network"},{"line_number":107,"context_line":"             (nondeterministic for AZs with same amount of agents scheduled)"},{"line_number":108,"context_line":"           - choose agent in the AZ with WeightScheduler"},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":"        if num_agents_needed \u003c\u003d 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_0870370a","line":107,"updated":"2016-05-27 05:33:00.000000000","message":"needs an update?","commit_id":"5a5e7aee9509677c53b64b4270626a082ec0d834"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"d02cf1cdb564bbc80b4db6c10623974564512378","unresolved":false,"context_lines":[{"line_number":104,"context_line":"           If the network has multiple AZs, agents are scheduled as"},{"line_number":105,"context_line":"           follows:"},{"line_number":106,"context_line":"           - select AZ with least agents scheduled for the network"},{"line_number":107,"context_line":"             (nondeterministic for AZs with same amount of agents scheduled)"},{"line_number":108,"context_line":"           - choose agent in the AZ with WeightScheduler"},{"line_number":109,"context_line":"        \"\"\""},{"line_number":110,"context_line":"        if num_agents_needed \u003c\u003d 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_2c0cea93","line":107,"in_reply_to":"dab17558_0870370a","updated":"2016-05-27 10:45:45.000000000","message":"Done","commit_id":"5a5e7aee9509677c53b64b4270626a082ec0d834"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"a3c900bb34c536d1151d42c24fd2bfd3f521e554","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        # the number of AZs, we want to select agents with less weight."},{"line_number":120,"context_line":"        # Use an OrderedDict here, so that the AZ with least weight agent"},{"line_number":121,"context_line":"        # will be recorded first in the case described above. And, as a result,"},{"line_number":122,"context_line":"        # the agent with least weight will be used first."},{"line_number":123,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":124,"context_line":"        # resource_hostable_agents should be a list with agents in the order of"},{"line_number":125,"context_line":"        # their weight."}],"source_content_type":"text/x-python","patch_set":8,"id":"dab17558_881427a0","line":122,"updated":"2016-05-27 05:33:00.000000000","message":"can there be a test case which ensures the case?\neg. swapping az names won\u0027t change the result.","commit_id":"5a5e7aee9509677c53b64b4270626a082ec0d834"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"d02cf1cdb564bbc80b4db6c10623974564512378","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        # the number of AZs, we want to select agents with less weight."},{"line_number":120,"context_line":"        # Use an OrderedDict here, so that the AZ with least weight agent"},{"line_number":121,"context_line":"        # will be recorded first in the case described above. And, as a result,"},{"line_number":122,"context_line":"        # the agent with least weight will be used first."},{"line_number":123,"context_line":"        num_az_agents \u003d collections.OrderedDict()"},{"line_number":124,"context_line":"        # resource_hostable_agents should be a list with agents in the order of"},{"line_number":125,"context_line":"        # their weight."}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_ec7822fb","line":122,"in_reply_to":"dab17558_881427a0","updated":"2016-05-27 10:45:45.000000000","message":"There will one such test case in next patch set.","commit_id":"5a5e7aee9509677c53b64b4270626a082ec0d834"}],"neutron/tests/unit/scheduler/test_dhcp_agent_scheduler.py":[{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"7231c5803f38559b01b7557e6a3fde67d6e304f5","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        self._test_az_scheduler_no_az_hints(multiple_agent\u003dTrue)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def test_az_scheduler_no_az_hints_one_agent(self):"},{"line_number":612,"context_line":"        self._test_az_scheduler_no_az_hints(multiple_agent\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a122d0e_f8269b14","line":612,"updated":"2016-05-05 05:38:21.000000000","message":"no need to pass multiple_agent\u003dFalse as the caller already takes care of the default value.","commit_id":"01125bdd13272a34bb25126e6d26a27880ba0940"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"42a990d4ab5e51e2e49a5069d9edeac5d653b9b3","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        self._test_az_scheduler_no_az_hints(multiple_agent\u003dTrue)"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def test_az_scheduler_no_az_hints_one_agent(self):"},{"line_number":612,"context_line":"        self._test_az_scheduler_no_az_hints(multiple_agent\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"dab17558_40af782b","line":612,"in_reply_to":"1a122d0e_f8269b14","updated":"2016-05-12 09:36:50.000000000","message":"Done","commit_id":"01125bdd13272a34bb25126e6d26a27880ba0940"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"b3a6aec89a22d4f8b53321e7e66f21674d27011d","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        dhcp_agents.append("},{"line_number":631,"context_line":"            helpers.register_dhcp_agent(\u0027az3-host2\u0027, networks\u003d1, az\u003d\u0027az3\u0027))"},{"line_number":632,"context_line":"        # Shuffle the agents"},{"line_number":633,"context_line":"        random.shuffle(dhcp_agents)"},{"line_number":634,"context_line":"        # Select agents with empty resource_hosted_agents. This means each"},{"line_number":635,"context_line":"        # AZ will have same amount of agents scheduled (0 in this case)"},{"line_number":636,"context_line":"        agents_select \u003d self.plugin.network_scheduler.select("}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_e4c47b41","line":633,"updated":"2016-06-03 09:44:03.000000000","message":"if we use random this way, multiple iterations might be desirable to ensure a stable result.\nhow do you think?","commit_id":"e2df44c417e51113e0ae9f149b0301210576a6a5"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"2d3b27f260d8dfa0aa1af6b21df47ed0ec4bb7ee","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        dhcp_agents.append("},{"line_number":631,"context_line":"            helpers.register_dhcp_agent(\u0027az3-host2\u0027, networks\u003d1, az\u003d\u0027az3\u0027))"},{"line_number":632,"context_line":"        # Shuffle the agents"},{"line_number":633,"context_line":"        random.shuffle(dhcp_agents)"},{"line_number":634,"context_line":"        # Select agents with empty resource_hosted_agents. This means each"},{"line_number":635,"context_line":"        # AZ will have same amount of agents scheduled (0 in this case)"},{"line_number":636,"context_line":"        agents_select \u003d self.plugin.network_scheduler.select("}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_8c885fe9","line":633,"in_reply_to":"9abb7d3a_e4c47b41","updated":"2016-06-06 09:59:05.000000000","message":"My original thinking is that every run of this test is a different shuffle of agents. But I am ok to test multiple times of shuffle in one test run. Will update it in next patch.","commit_id":"e2df44c417e51113e0ae9f149b0301210576a6a5"}]}
