)]}'
{"neutron/agent/dhcp/agent.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d067f4a8beb1134612c2d27f9776284d41f3fe67","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            # this is just watching sets so we can do it really frequently"},{"line_number":265,"context_line":"            eventlet.sleep(0.1)"},{"line_number":266,"context_line":"            prio_ports_to_send \u003d set()"},{"line_number":267,"context_line":"            if self.dhcp_prio_ready_ports:"},{"line_number":268,"context_line":"                for port_count in range(min(len(self.dhcp_prio_ready_ports),"},{"line_number":269,"context_line":"                                            DHCP_READY_PORTS_SYNC_MAX)):"},{"line_number":270,"context_line":"                    prio_ports_to_send.add(self.dhcp_prio_ready_ports.pop())"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_9cd6584f","line":267,"updated":"2020-03-24 11:54:06.000000000","message":"Sorry for the late review.\n\nWhy instead of refactoring this method we don\u0027t just iterate the list of ports but in order?\n\nif itertools.chain(self.dhcp_prio_ready_ports,\n                   self.dhcp_ready_ports):\n...\n\n\nThis will treat first the prio ports. In case prio ports is less than DHCP_READY_PORTS_SYNC_MAX, the RPC message will be filled with non-prio ones.","commit_id":"b95648f91b5fa2b4444d1d874ea95fedf1ecc36a"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"4b42bc7eab43ddd1ebf47c0a9141359aeaab6905","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            # this is just watching sets so we can do it really frequently"},{"line_number":265,"context_line":"            eventlet.sleep(0.1)"},{"line_number":266,"context_line":"            prio_ports_to_send \u003d set()"},{"line_number":267,"context_line":"            if self.dhcp_prio_ready_ports:"},{"line_number":268,"context_line":"                for port_count in range(min(len(self.dhcp_prio_ready_ports),"},{"line_number":269,"context_line":"                                            DHCP_READY_PORTS_SYNC_MAX)):"},{"line_number":270,"context_line":"                    prio_ports_to_send.add(self.dhcp_prio_ready_ports.pop())"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_a0404237","line":267,"in_reply_to":"df33271e_9cd6584f","updated":"2020-03-24 21:47:42.000000000","message":"Rodolfo - thanks for the review.  itertools.chain() would be nice to use, and I think I tried something like it before, but the problem is on L289-290 - if for some reason the operation fails, we need to add the ports back to their respective lists.  If we merge them into a single list using chain, then we don\u0027t know where to put them.","commit_id":"b95648f91b5fa2b4444d1d874ea95fedf1ecc36a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b177c147bbf4a4f443337845397b80e63f661d76","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            # this is just watching sets so we can do it really frequently"},{"line_number":265,"context_line":"            eventlet.sleep(0.1)"},{"line_number":266,"context_line":"            prio_ports_to_send \u003d set()"},{"line_number":267,"context_line":"            if self.dhcp_prio_ready_ports:"},{"line_number":268,"context_line":"                for port_count in range(min(len(self.dhcp_prio_ready_ports),"},{"line_number":269,"context_line":"                                            DHCP_READY_PORTS_SYNC_MAX)):"},{"line_number":270,"context_line":"                    prio_ports_to_send.add(self.dhcp_prio_ready_ports.pop())"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_b35ff070","line":267,"in_reply_to":"df33271e_a0404237","updated":"2020-03-25 16:38:12.000000000","message":"Good point. That could be solved in the count loop doing something like:\nport_chain \u003d itertools.chain(self.dhcp_prio_ready_ports,\n                             self.dhcp_ready_ports)\nport_chain_len \u003d len(list(port_chain))\nfor port_count in range(min(port_chain_len,\n                            DHCP_READY_PORTS_SYNC_MAX)):\n  if prio:\n    prio_ports_to_send.add(self.dhcp_prio_ready_ports.pop())\n    continue\n  ports_to_send.add(self.dhcp_ready_ports.pop())\n\n\nBut the code is OK right now, that was a soft -1","commit_id":"b95648f91b5fa2b4444d1d874ea95fedf1ecc36a"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f0cab74488d4163c6a8efa743f363ab6111f0244","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            # this is just watching sets so we can do it really frequently"},{"line_number":265,"context_line":"            eventlet.sleep(0.1)"},{"line_number":266,"context_line":"            prio_ports_to_send \u003d set()"},{"line_number":267,"context_line":"            if self.dhcp_prio_ready_ports:"},{"line_number":268,"context_line":"                for port_count in range(min(len(self.dhcp_prio_ready_ports),"},{"line_number":269,"context_line":"                                            DHCP_READY_PORTS_SYNC_MAX)):"},{"line_number":270,"context_line":"                    prio_ports_to_send.add(self.dhcp_prio_ready_ports.pop())"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_aeb5c3cf","line":267,"in_reply_to":"df33271e_b35ff070","updated":"2020-03-25 17:16:07.000000000","message":"Yes, this could be done in one loop, even without itertools, i\u0027ll send a quick update.","commit_id":"b95648f91b5fa2b4444d1d874ea95fedf1ecc36a"}],"neutron/tests/unit/agent/dhcp/test_agent.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"41a8818d2da471962969b945b7b0e8843056489f","unresolved":false,"context_lines":[{"line_number":510,"context_line":"        self.assertEqual(set(range(sync_max, sync_max + port_count)),"},{"line_number":511,"context_line":"                         dhcp.dhcp_ready_ports)"},{"line_number":512,"context_line":"        # one call is expected, with DHCP_READY_PORTS_SYNC_MAX ports"},{"line_number":513,"context_line":"        ready.assert_called_once()"},{"line_number":514,"context_line":"        self.assertEqual(sync_max, len(ready.call_args_list[0][0][0]))"},{"line_number":515,"context_line":"        # priority ports need to be ready"},{"line_number":516,"context_line":"        ports_ready \u003d ready.call_args_list[0][0][0]"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_79bbc2e4","line":513,"updated":"2020-03-22 02:19:08.000000000","message":"This passed somehow, but I think it\u0027s wrong, need to investigate.","commit_id":"b95648f91b5fa2b4444d1d874ea95fedf1ecc36a"}]}
