)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7cb9b92af4f12e0226689ae49db23d339931f16b","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Maysa Macedo \u003cmaysa.macedo95@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2021-12-13 15:04:39 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add lock to pools poulation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We have seen issues that the Neutron Server was not"},{"line_number":10,"context_line":"able to respond in time during the creation of Ports"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"f332311a_13704a5a","line":7,"range":{"start_line":7,"start_character":18,"end_line":7,"end_character":27},"updated":"2021-12-14 16:05:36.000000000","message":"population","commit_id":"a214a5c8f50db4ac37c639c5b22f83742ce3fcfe"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"eda2ed4b839a1c825588ca0310979c8dc1328f78","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"d905abf3_bc522ffb","updated":"2021-12-03 10:16:08.000000000","message":"I need to put a bit more thought into how to do it in a pretty way. :/ That code is really complicated.","commit_id":"893fa8c238da2d931d0c6bf462b43ae626dabd0c"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"8786ed9973fb8fc2f6194b6de76e091f692cd59a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"2f3fa00f_42eebc76","updated":"2021-12-03 09:43:03.000000000","message":"Needs adjustments in the unit tests","commit_id":"893fa8c238da2d931d0c6bf462b43ae626dabd0c"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"ff83cbe5cf011b67d706a1c1c4c6a1685ccea965","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"372c7bdd_b87f115a","updated":"2021-12-13 11:40:23.000000000","message":"Code looks good. Would be nice to also update the documentation to drop the ports_pool_update_frequency related information","commit_id":"4c2af0aca0ebc6a9223a153ad24e6d294b3c6c0f"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7cb9b92af4f12e0226689ae49db23d339931f16b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"0fbc7fca_f9b0a6c2","updated":"2021-12-14 16:05:36.000000000","message":"Alright, this looks great.","commit_id":"a214a5c8f50db4ac37c639c5b22f83742ce3fcfe"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"d0876b7013e6f0834e3d64fd09e7e56fd4f16093","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"c6c57435_ca368099","updated":"2021-12-13 17:39:43.000000000","message":"recheck","commit_id":"a214a5c8f50db4ac37c639c5b22f83742ce3fcfe"}],"kuryr_kubernetes/controller/drivers/vif_pool.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9ba229dc9c20402363e46f7d725551d2b016a271","unresolved":true,"context_lines":[{"line_number":233,"context_line":"            return"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        # Allow only one population per pool to happen at a time"},{"line_number":236,"context_line":"        with lockutils.lock(pool_key):"},{"line_number":237,"context_line":"            pool_size \u003d self._get_pool_size(pool_key)"},{"line_number":238,"context_line":"            ports_pool_min \u003d oslo_cfg.CONF.vif_pool.ports_pool_min"},{"line_number":239,"context_line":"            if pool_size \u003c ports_pool_min:"}],"source_content_type":"text/x-python","patch_set":1,"id":"687df3ff_d251165e","line":236,"range":{"start_line":236,"start_character":0,"end_line":236,"end_character":38},"updated":"2021-12-03 10:14:30.000000000","message":"Hm, I wasn\u0027t planning to do it this way, but technically this should be enough, because if some population happened when this was waiting for the lock, line 239 will prevent it from actually doing the work.\n\nMy plan was rather to try to acquire the lock here and if that would be unsuccessful, to raise ResourceNotReady so it\u0027ll be retried a while later when pool might already be populated.\n\nNow what seems ugly here is that _populate_pool seems to be run in request_vif when pools is empty, but also in every successful run of _get_port_from_pool. I think this is to cover some kuryr-controller restart corner cases, but it does seem a bit weird.","commit_id":"404856a7d3e57f942320290a02651308ed7d57d2"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9ba229dc9c20402363e46f7d725551d2b016a271","unresolved":true,"context_lines":[{"line_number":252,"context_line":"                            security_groups, []).append(vif.id)"},{"line_number":253,"context_line":"                if vifs:"},{"line_number":254,"context_line":"                    now \u003d time.time()"},{"line_number":255,"context_line":"                    self._last_update[pool_key] \u003d {security_groups: now}"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def release_vif(self, pod, vif, project_id, security_groups,"},{"line_number":258,"context_line":"                    host_addr\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"62d471f9_aaededd6","line":255,"range":{"start_line":255,"start_character":0,"end_line":255,"end_character":72},"updated":"2021-12-03 10:14:30.000000000","message":"Why do we still need to save _last_update? I see some usages in _get_port_from_pool but I don\u0027t exactly understand why they\u0027re there.","commit_id":"404856a7d3e57f942320290a02651308ed7d57d2"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"76dbb2f16f7bb02380f80ef896452f8609dd2356","unresolved":true,"context_lines":[{"line_number":212,"context_line":"                                            tuple(sorted(security_groups)))"},{"line_number":213,"context_line":"        except exceptions.ResourceNotReady:"},{"line_number":214,"context_line":"            LOG.debug(\"Ports pool does not have available ports: %s\", pool_key)"},{"line_number":215,"context_line":"            self._populate_pool(pool_key, pod, subnets, tuple(sorted(security_groups)),"},{"line_number":216,"context_line":"                                raise_not_ready\u003dTrue)"},{"line_number":217,"context_line":"            raise"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def _get_port_from_pool(self, pool_key, pod, subnets, security_groups):"}],"source_content_type":"text/x-python","patch_set":4,"id":"f3a1b148_1317c410","line":216,"range":{"start_line":215,"start_character":0,"end_line":216,"end_character":53},"updated":"2021-12-09 11:42:59.000000000","message":"You\u0027ve removed `raise` from here, I bet this won\u0027t work as expected now. In general I\u0027d rather move this _populate_pool to inside _get_port_from_pool and deal with it there. The ultimate goal of _get_port_from_pool is to return a port, regardless of if it needed to run _populate_pool or not.","commit_id":"979650e063554b21f1ec8ff1d6b9fe0759edc143"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"76dbb2f16f7bb02380f80ef896452f8609dd2356","unresolved":true,"context_lines":[{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _get_pool_lock(self, name):"},{"line_number":223,"context_line":"        with self._lock:"},{"line_number":224,"context_line":"            try:"},{"line_number":225,"context_line":"                return self._locks[name]"},{"line_number":226,"context_line":"            except KeyError:"},{"line_number":227,"context_line":"                pool_lock \u003d threading.Lock()"},{"line_number":228,"context_line":"                self._locks[name] \u003d pool_lock"},{"line_number":229,"context_line":"                return pool_lock"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def _populate_pool(self, pool_key, pod, subnets, security_groups,"},{"line_number":232,"context_line":"                       raise_not_ready\u003dTrue):"},{"line_number":233,"context_line":"        # REVISIT(ltomasbo): Drop the subnets parameter and get the information"}],"source_content_type":"text/x-python","patch_set":4,"id":"22bd8921_25eb1583","line":230,"range":{"start_line":224,"start_character":0,"end_line":230,"end_character":0},"updated":"2021-12-09 11:42:59.000000000","message":"Why don\u0027t just use collections.defaultdict(threading.Lock):\n\n In [4]: a \u003d collections.defaultdict(threading.Lock)\n In [5]: a[1]\n Out[5]: \u003cunlocked _thread.lock object at 0x7f0d6137e3c0\u003e\n In [6]: a[2]\n Out[6]: \u003cunlocked _thread.lock object at 0x7f0d612d7c30\u003e","commit_id":"979650e063554b21f1ec8ff1d6b9fe0759edc143"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"76dbb2f16f7bb02380f80ef896452f8609dd2356","unresolved":true,"context_lines":[{"line_number":244,"context_line":"        lock \u003d self._get_pool_lock(pool_key)"},{"line_number":245,"context_line":"        if lock.acquire(timeout\u003d300):"},{"line_number":246,"context_line":"            pool_size \u003d self._get_pool_size(pool_key)"},{"line_number":247,"context_line":"            if pool_size \u003c ports_pool_min:"},{"line_number":248,"context_line":"                num_ports \u003d max(oslo_cfg.CONF.vif_pool.ports_pool_batch,"},{"line_number":249,"context_line":"                                ports_pool_min - pool_size)"},{"line_number":250,"context_line":"                vifs \u003d self._drv_vif.request_vifs("}],"source_content_type":"text/x-python","patch_set":4,"id":"9e8d71c4_84f147c4","line":247,"range":{"start_line":247,"start_character":15,"end_line":247,"end_character":41},"updated":"2021-12-09 11:42:59.000000000","message":"Hm, it\u0027s nice to move it here, I think.","commit_id":"979650e063554b21f1ec8ff1d6b9fe0759edc143"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"76dbb2f16f7bb02380f80ef896452f8609dd2356","unresolved":true,"context_lines":[{"line_number":261,"context_line":"                if vifs:"},{"line_number":262,"context_line":"                    now \u003d time.time()"},{"line_number":263,"context_line":"                    self._last_update[pool_key] \u003d {security_groups: now}"},{"line_number":264,"context_line":"            lock.release()"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"    def release_vif(self, pod, vif, project_id, security_groups,"},{"line_number":267,"context_line":"                    host_addr\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"32401dbe_b6090b20","line":264,"range":{"start_line":264,"start_character":12,"end_line":264,"end_character":26},"updated":"2021-12-09 11:42:59.000000000","message":"You got to have this in finally clause of a try block, just to make sure it\u0027s released even if request_vifs raises.","commit_id":"979650e063554b21f1ec8ff1d6b9fe0759edc143"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"26549532b20c6888e567bb92f3f91c9385e76e0b","unresolved":true,"context_lines":[{"line_number":212,"context_line":"            return self._get_port_from_pool(pool_key, pod, subnets,"},{"line_number":213,"context_line":"                                            tuple(sorted(security_groups)))"},{"line_number":214,"context_line":"        except exceptions.ResourceNotReady:"},{"line_number":215,"context_line":"            # NOTE(dulek): We\u0027re passing raise_not_ready\u003dFalse because this"},{"line_number":216,"context_line":"            #              will be run outside of handlers thread, so raising"},{"line_number":217,"context_line":"            #              it will only result in an ugly log from eventlet."},{"line_number":218,"context_line":"            pool_populated \u003d self._populate_pool("},{"line_number":219,"context_line":"                pool_key, pod, subnets, tuple(sorted(security_groups)))"},{"line_number":220,"context_line":"            if not pool_populated:"}],"source_content_type":"text/x-python","patch_set":5,"id":"53406e19_d538e0f0","line":217,"range":{"start_line":215,"start_character":0,"end_line":217,"end_character":76},"updated":"2021-12-09 16:44:27.000000000","message":"This isn\u0027t true anymore.","commit_id":"e2132ea452688697d11e17cfa8c5945ceea0bae7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"26549532b20c6888e567bb92f3f91c9385e76e0b","unresolved":true,"context_lines":[{"line_number":221,"context_line":"                raise"},{"line_number":222,"context_line":"            # NOTE(maysams): Try retrieving the Port as soon as it become"},{"line_number":223,"context_line":"            # available"},{"line_number":224,"context_line":"            port \u003d self._get_port_from_pool("},{"line_number":225,"context_line":"                pool_key, pod, subnets, tuple(sorted(security_groups)))"},{"line_number":226,"context_line":"            if not port:"},{"line_number":227,"context_line":"                raise"},{"line_number":228,"context_line":"        return port"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_port_from_pool(self, pool_key, pod, subnets, security_groups):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aecdf5d_27a3d9ba","line":227,"range":{"start_line":224,"start_character":0,"end_line":227,"end_character":21},"updated":"2021-12-09 16:44:27.000000000","message":"This can be just\n\n return self._get_port_from_pool(pool_key, pod, subnets, tuple(sorted(security_groups)))\n\n_get_port_from_pool will raise ResourceNotReady anyway.","commit_id":"e2132ea452688697d11e17cfa8c5945ceea0bae7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"26549532b20c6888e567bb92f3f91c9385e76e0b","unresolved":true,"context_lines":[{"line_number":243,"context_line":"            return False"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        ports_pool_min \u003d oslo_cfg.CONF.vif_pool.ports_pool_min"},{"line_number":246,"context_line":"        lock \u003d self.get(pool_key)"},{"line_number":247,"context_line":"        if lock.acquire(timeout\u003d300):"},{"line_number":248,"context_line":"            pool_size \u003d self._get_pool_size(pool_key)"},{"line_number":249,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"a7464571_e4bd06c8","line":246,"range":{"start_line":246,"start_character":8,"end_line":246,"end_character":33},"updated":"2021-12-09 16:44:27.000000000","message":"Ah, this won\u0027t work. :P","commit_id":"e2132ea452688697d11e17cfa8c5945ceea0bae7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"26549532b20c6888e567bb92f3f91c9385e76e0b","unresolved":true,"context_lines":[{"line_number":244,"context_line":""},{"line_number":245,"context_line":"        ports_pool_min \u003d oslo_cfg.CONF.vif_pool.ports_pool_min"},{"line_number":246,"context_line":"        lock \u003d self.get(pool_key)"},{"line_number":247,"context_line":"        if lock.acquire(timeout\u003d300):"},{"line_number":248,"context_line":"            pool_size \u003d self._get_pool_size(pool_key)"},{"line_number":249,"context_line":"            try:"},{"line_number":250,"context_line":"                if pool_size \u003c ports_pool_min:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fe3a5abc_e0934e75","line":247,"range":{"start_line":247,"start_character":0,"end_line":247,"end_character":37},"updated":"2021-12-09 16:44:27.000000000","message":"Shouldn\u0027t we raise on else of this if? Or at least return False.","commit_id":"e2132ea452688697d11e17cfa8c5945ceea0bae7"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"ff83cbe5cf011b67d706a1c1c4c6a1685ccea965","unresolved":true,"context_lines":[{"line_number":216,"context_line":"        try:"},{"line_number":217,"context_line":"            return self._get_port_from_pool(pool_key, pod, subnets,"},{"line_number":218,"context_line":"                                            tuple(sorted(security_groups)))"},{"line_number":219,"context_line":"        except exceptions.ResourceNotReady:"},{"line_number":220,"context_line":"            if self._populate_pool(pool_key, pod, subnets,"},{"line_number":221,"context_line":"                                   tuple(sorted(security_groups))):"},{"line_number":222,"context_line":"                return self._get_port_from_pool("}],"source_content_type":"text/x-python","patch_set":9,"id":"e8cf6bf9_361614c1","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":43},"updated":"2021-12-13 11:40:23.000000000","message":"perhaps worth to still have a log.debug message saying the pool will be populated as there was not enough ports on it","commit_id":"4c2af0aca0ebc6a9223a153ad24e6d294b3c6c0f"}]}
