)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"b49053a8e081fbaf008e877524321ed7ba54905b","unresolved":false,"context_lines":[{"line_number":28,"context_line":"IpsetManager.set_members() with the same arguments. This will affect"},{"line_number":29,"context_line":"performance by reducing the amount of file locking around ipset when"},{"line_number":30,"context_line":"adding servers to security groups."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Change-Id: Id2c8c8c1093c8abcf1fd897b23b0358aeb55b526"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa32b979_0208aa90","line":31,"updated":"2015-06-19 08:03:10.000000000","message":"Nice. Can you file a bug for this and mark it here? I\u0027m interested in tracking performance enhancing patches this cycle.","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"ea1c86a7e2e414292a3bddc89caaa8264daba383","unresolved":false,"context_lines":[{"line_number":28,"context_line":"IpsetManager.set_members() with the same arguments. This will affect"},{"line_number":29,"context_line":"performance by reducing the amount of file locking around ipset when"},{"line_number":30,"context_line":"adding servers to security groups."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Change-Id: Id2c8c8c1093c8abcf1fd897b23b0358aeb55b526"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa32b979_c4e39c04","line":31,"in_reply_to":"fa32b979_0208aa90","updated":"2015-06-19 16:47:00.000000000","message":"Yes, I\u0027ll file a bug report and add that here in my next PS.","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"}],"neutron/agent/linux/iptables_firewall.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ced53cdbe203fcfc8f66b6f1574825cae43166a3","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        else:"},{"line_number":431,"context_line":"            yield rule"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def _get_remote_sg_ids(self, port, direction\u003dNone):"},{"line_number":434,"context_line":"        sg_ids \u003d port.get(\u0027security_groups\u0027, [])"},{"line_number":435,"context_line":"        remote_sg_ids \u003d {constants.IPv4: [], constants.IPv6: []}"},{"line_number":436,"context_line":"        for sg_id in sg_ids:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_a1b2314a","side":"PARENT","line":433,"updated":"2015-06-18 19:25:00.000000000","message":"Would it be a better optimization if this method were enhanced to return only distinct sg_ids? We might be able to get the db to do the work of aggregating them for us.","commit_id":"f12a65ad07a87fe98a9d47b9ccb96e97798e6371"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"0a4cc839436734270c936cb7a3c92c8e605bd35e","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        else:"},{"line_number":431,"context_line":"            yield rule"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def _get_remote_sg_ids(self, port, direction\u003dNone):"},{"line_number":434,"context_line":"        sg_ids \u003d port.get(\u0027security_groups\u0027, [])"},{"line_number":435,"context_line":"        remote_sg_ids \u003d {constants.IPv4: [], constants.IPv6: []}"},{"line_number":436,"context_line":"        for sg_id in sg_ids:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_dcc87eaa","side":"PARENT","line":433,"in_reply_to":"fa32b979_01375d4d","updated":"2015-06-18 19:54:57.000000000","message":"Okay, I guess it does make more sense to fix it here. Do you think wrapping the returned list in a set() like my originally proposed change will suffice? The other option would be to keep a separate set of appended IDs and check that before adding (not sure if that would be better).","commit_id":"f12a65ad07a87fe98a9d47b9ccb96e97798e6371"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ba03934259911af6fef453acfd3e54c2cac27ff1","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        else:"},{"line_number":431,"context_line":"            yield rule"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    def _get_remote_sg_ids(self, port, direction\u003dNone):"},{"line_number":434,"context_line":"        sg_ids \u003d port.get(\u0027security_groups\u0027, [])"},{"line_number":435,"context_line":"        remote_sg_ids \u003d {constants.IPv4: [], constants.IPv6: []}"},{"line_number":436,"context_line":"        for sg_id in sg_ids:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_01375d4d","side":"PARENT","line":433,"in_reply_to":"fa32b979_a1b2314a","updated":"2015-06-18 19:34:47.000000000","message":"On second thought, the way this is written, it would be difficult for the db to do the work.  However, I think a set could be constructed directly in this method and returned rather than forcing it in to a set after the fact on L486.","commit_id":"f12a65ad07a87fe98a9d47b9ccb96e97798e6371"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ced53cdbe203fcfc8f66b6f1574825cae43166a3","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    def _update_ipset_members(self, security_group_ids):"},{"line_number":485,"context_line":"        for ip_version, sg_ids in security_group_ids.items():"},{"line_number":486,"context_line":"            for sg_id in set(sg_ids):"},{"line_number":487,"context_line":"                current_ips \u003d self.sg_members[sg_id][ip_version]"},{"line_number":488,"context_line":"                self.ipset.set_members(sg_id, ip_version, current_ips)"},{"line_number":489,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_61e66945","line":486,"updated":"2015-06-18 19:25:00.000000000","message":"Is there a unit test here which could be enhanced to check that this is only called once per distinct id?","commit_id":"39a55ee03c0b17bea82e25ee29755190fc317f98"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"0a4cc839436734270c936cb7a3c92c8e605bd35e","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    def _update_ipset_members(self, security_group_ids):"},{"line_number":485,"context_line":"        for ip_version, sg_ids in security_group_ids.items():"},{"line_number":486,"context_line":"            for sg_id in set(sg_ids):"},{"line_number":487,"context_line":"                current_ips \u003d self.sg_members[sg_id][ip_version]"},{"line_number":488,"context_line":"                self.ipset.set_members(sg_id, ip_version, current_ips)"},{"line_number":489,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa32b979_9c7f5614","line":486,"in_reply_to":"fa32b979_61e66945","updated":"2015-06-18 19:54:57.000000000","message":"There is a small unit test in tests/unit/agent/linux/test_iptables_firewall.py called test_update_ipset_members; I\u0027ll have to take a look a play around with it.","commit_id":"39a55ee03c0b17bea82e25ee29755190fc317f98"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ba51108b20beba52ba96eabe4f45504e46b6b332","unresolved":false,"context_lines":[{"line_number":636,"context_line":"        We do the calculation for each ip_version."},{"line_number":637,"context_line":"        \"\"\""},{"line_number":638,"context_line":"        sgs_to_remove_per_ipversion \u003d {constants.IPv4: set(),"},{"line_number":639,"context_line":"                                       constants.IPv6: set()}"},{"line_number":640,"context_line":"        remote_group_id_sets \u003d self._get_remote_sg_ids_sets_by_ipversion("},{"line_number":641,"context_line":"            filtered_ports)"},{"line_number":642,"context_line":"        for ip_version, remote_group_id_set in ("}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_9747161d","line":639,"updated":"2015-06-19 10:50:15.000000000","message":"here you can use _get_remote_sg_ids directly now","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"ba51108b20beba52ba96eabe4f45504e46b6b332","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_b76c9ad1","line":647,"updated":"2015-06-19 10:50:15.000000000","message":"this method is not needed anymore since you modified _get_remote_sg_ids to return sets","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"22167e0f58a6fe850675a5d32780ca1175a67314","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_6df2b071","line":647,"in_reply_to":"fa32b979_17aa1586","updated":"2015-06-19 17:36:10.000000000","message":"Oops, nevermind the confusion. I was misunderstanding what the update() method was doing to the set.","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"7e30ca5f9308ab52d61f527e067fac4877048115","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_75c7c045","line":647,"in_reply_to":"fa32b979_4411be5c","updated":"2015-06-21 15:10:10.000000000","message":"OK for me!","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6efc7abb519062b0ddad6d70a354246257e4ae96","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_7b6d71cb","line":647,"in_reply_to":"fa32b979_75c7c045","updated":"2015-06-21 19:50:49.000000000","message":"+1 For carl\u0027s suggestion","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ba0a01f9783e72404161fbed8cf8a430a9dec079","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_4411be5c","line":647,"in_reply_to":"fa32b979_906b8b85","updated":"2015-06-19 21:31:22.000000000","message":"I think both Rossella and Rawlin have good points.  Might I suggest an in-between which allows this method to benefit from the new behavior of _get_remote_sg_ids?  See below.","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"ec0b2de32e10e665f8da4e97302040deb17afc58","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_906b8b85","line":647,"in_reply_to":"fa32b979_b76c9ad1","updated":"2015-06-19 17:50:54.000000000","message":"I think this method is still necessary because it iterates over a list of ports instead of just a single port like _get_remote_sg_ids(). Is that right?","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"ea1c86a7e2e414292a3bddc89caaa8264daba383","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            sgs_to_remove_per_ipversion[ip_version].update("},{"line_number":645,"context_line":"                set(self.pre_sg_members) - remote_group_id_set)"},{"line_number":646,"context_line":"        return sgs_to_remove_per_ipversion"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"    def _get_remote_sg_ids_sets_by_ipversion(self, filtered_ports):"},{"line_number":649,"context_line":"        \"\"\"Given a port, calculates the remote sg references by ip_version.\"\"\""},{"line_number":650,"context_line":"        remote_group_id_sets \u003d {constants.IPv4: set(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_17aa1586","line":647,"in_reply_to":"fa32b979_b76c9ad1","updated":"2015-06-19 16:47:00.000000000","message":"This method confuses me because it iterates over each port in filtered_ports but updates the set of sg_ids for every port. When this method returns, doesn\u0027t it only update the sets to the sg_ids of the last port in filtered_ports? I.e. only the last port in filtered_ports matters?","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ba0a01f9783e72404161fbed8cf8a430a9dec079","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                                constants.IPv6: set()}"},{"line_number":652,"context_line":"        for port in filtered_ports:"},{"line_number":653,"context_line":"            remote_sg_ids \u003d self._get_remote_sg_ids(port)"},{"line_number":654,"context_line":"            for ip_version, sg_ids in six.iteritems(remote_sg_ids):"},{"line_number":655,"context_line":"                remote_group_id_sets[ip_version].update(sg_ids)"},{"line_number":656,"context_line":"        return remote_group_id_sets"},{"line_number":657,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_27483c2d","line":654,"updated":"2015-06-19 21:31:22.000000000","message":"Change this for loop to:\n\n  for ip_version in (constants.IPv4, constants.IPv6):\n      remote_group_id_set[version] |\u003d remote_sg_ids[version]","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6efc7abb519062b0ddad6d70a354246257e4ae96","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                                constants.IPv6: set()}"},{"line_number":652,"context_line":"        for port in filtered_ports:"},{"line_number":653,"context_line":"            remote_sg_ids \u003d self._get_remote_sg_ids(port)"},{"line_number":654,"context_line":"            for ip_version, sg_ids in six.iteritems(remote_sg_ids):"},{"line_number":655,"context_line":"                remote_group_id_sets[ip_version].update(sg_ids)"},{"line_number":656,"context_line":"        return remote_group_id_sets"},{"line_number":657,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_db783d92","line":654,"in_reply_to":"fa32b979_27483c2d","updated":"2015-06-21 19:50:49.000000000","message":"+1 :)","commit_id":"7037edac94df4b4fc3def5f6a2fc9b935ee4857c"}]}
