)]}'
{"glance/common/wsgi_app.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f6b5c403fcb19f25227d276f83c140a2621c4ce3","unresolved":true,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"def cache_images(cache_prefetcher):"},{"line_number":107,"context_line":"    # After every \u0027cache_prefetcher_interval\u0027 this call will run and fetch"},{"line_number":108,"context_line":"    # all queued images into cache if there are any"},{"line_number":109,"context_line":"    cache_thread \u003d threading.Timer(CONF.cache_prefetcher_interval,"},{"line_number":110,"context_line":"                                   cache_images, (cache_prefetcher,))"},{"line_number":111,"context_line":"    cache_thread.daemon \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"294a77b8_095566a8","line":108,"updated":"2021-08-10 13:57:28.000000000","message":"Any wsgi container will generally be recycling workers after max_requests (or equivalent) which means that if they all run this, they will get their timers evenly distributed, and provide an interval of roughly N/$workers instead of what they actually configured. If they configure an interval of 60 minutes and 30 workers (which would not be crazy) then there will be a lot more activity than they expect, and they may be consuming a ton of resources if there are lots of images to download.","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"01cf2a53c794a2f379614ad88e9d66f3cd79e56c","unresolved":true,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"def run_cache_prefetcher():"},{"line_number":117,"context_line":"    if not CONF.paste_deploy.flavor \u003d\u003d \u0027keystone+cachemanagement\u0027:"},{"line_number":118,"context_line":"        LOG.debug(\u0027Cache not enabled, skipping prefetching images in cache!!!\u0027)"},{"line_number":119,"context_line":"        return"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1bd0e31a_64d33037","line":117,"range":{"start_line":117,"start_character":4,"end_line":117,"end_character":66},"updated":"2021-08-10 13:39:37.000000000","message":"This would be very confusing for anyone with custom flavors or anyone running \u0027keystone+caching\u0027 as they would not be having prefetcher running.\n\nWe really should look if the CONF.image_cache_dir exists rather than looking for specific flavour name. That config option gets registered by the cache middleware and does not rely on hardcoded flavor name to work.","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b533ae2ed2a9dcc5b5ec4358abbb611ebe2d1c06","unresolved":true,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"def run_cache_prefetcher():"},{"line_number":117,"context_line":"    if not CONF.paste_deploy.flavor \u003d\u003d \u0027keystone+cachemanagement\u0027:"},{"line_number":118,"context_line":"        LOG.debug(\u0027Cache not enabled, skipping prefetching images in cache!!!\u0027)"},{"line_number":119,"context_line":"        return"},{"line_number":120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"becb6bbc_5160268e","line":117,"range":{"start_line":117,"start_character":4,"end_line":117,"end_character":66},"in_reply_to":"1bd0e31a_64d33037","updated":"2021-08-10 14:15:22.000000000","message":"This should be fixed in different patch as we need to make similar change in glance/cmd/api.py as well.","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"}],"glance/image_cache/prefetcher.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"49705bced478ce7f808f142a2fd56a3150a71d73","unresolved":true,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def fetch_image_into_cache(self, image_id):"},{"line_number":43,"context_line":"        ctx \u003d context.RequestContext(is_admin\u003dTrue, show_deleted\u003dTrue,"},{"line_number":44,"context_line":"                                     roles\u003d[\u0027admin\u0027])"},{"line_number":45,"context_line":"        try:"},{"line_number":46,"context_line":"            image_repo \u003d self.gateway.get_repo(ctx)"},{"line_number":47,"context_line":"            image \u003d image_repo.get(image_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"59fa4d68_c728f3f8","line":44,"range":{"start_line":44,"start_character":37,"end_line":44,"end_character":52},"updated":"2021-08-09 15:34:57.000000000","message":"without this I am not able to get images having shared,private visibility even if is_admin is true (get_image policy fails at line #47, we need a separate patch to enforce policy as per new framework here). Without this roles are empty list in the context.","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f6b5c403fcb19f25227d276f83c140a2621c4ce3","unresolved":true,"context_lines":[{"line_number":79,"context_line":"        num_images \u003d len(images)"},{"line_number":80,"context_line":"        LOG.debug(\"Found %d images to prefetch\", num_images)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        pool \u003d eventlet.GreenPool(num_images)"},{"line_number":83,"context_line":"        results \u003d pool.imap(self.fetch_image_into_cache, images)"},{"line_number":84,"context_line":"        successes \u003d sum([1 for r in results if r is True])"},{"line_number":85,"context_line":"        if successes !\u003d num_images:"}],"source_content_type":"text/x-python","patch_set":1,"id":"e6af8f97_c9a7f084","line":82,"updated":"2021-08-10 13:57:28.000000000","message":"This needs to be common.get_thread_pool()","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b533ae2ed2a9dcc5b5ec4358abbb611ebe2d1c06","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        num_images \u003d len(images)"},{"line_number":80,"context_line":"        LOG.debug(\"Found %d images to prefetch\", num_images)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        pool \u003d eventlet.GreenPool(num_images)"},{"line_number":83,"context_line":"        results \u003d pool.imap(self.fetch_image_into_cache, images)"},{"line_number":84,"context_line":"        successes \u003d sum([1 for r in results if r is True])"},{"line_number":85,"context_line":"        if successes !\u003d num_images:"}],"source_content_type":"text/x-python","patch_set":1,"id":"577c990a_a1e56b61","line":82,"in_reply_to":"e6af8f97_c9a7f084","updated":"2021-08-10 14:15:22.000000000","message":"Ack","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f6b5c403fcb19f25227d276f83c140a2621c4ce3","unresolved":true,"context_lines":[{"line_number":80,"context_line":"        LOG.debug(\"Found %d images to prefetch\", num_images)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        pool \u003d eventlet.GreenPool(num_images)"},{"line_number":83,"context_line":"        results \u003d pool.imap(self.fetch_image_into_cache, images)"},{"line_number":84,"context_line":"        successes \u003d sum([1 for r in results if r is True])"},{"line_number":85,"context_line":"        if successes !\u003d num_images:"},{"line_number":86,"context_line":"            LOG.warn(_LW(\"Failed to successfully cache all \""}],"source_content_type":"text/x-python","patch_set":1,"id":"599b6aa1_8cc40d8c","line":83,"updated":"2021-08-10 13:57:28.000000000","message":"The glance.async_.ThreadPoolModel will need a map implementation.","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b533ae2ed2a9dcc5b5ec4358abbb611ebe2d1c06","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        LOG.debug(\"Found %d images to prefetch\", num_images)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"        pool \u003d eventlet.GreenPool(num_images)"},{"line_number":83,"context_line":"        results \u003d pool.imap(self.fetch_image_into_cache, images)"},{"line_number":84,"context_line":"        successes \u003d sum([1 for r in results if r is True])"},{"line_number":85,"context_line":"        if successes !\u003d num_images:"},{"line_number":86,"context_line":"            LOG.warn(_LW(\"Failed to successfully cache all \""}],"source_content_type":"text/x-python","patch_set":1,"id":"b7d29442_12ffb4bf","line":83,"in_reply_to":"599b6aa1_8cc40d8c","updated":"2021-08-10 14:15:22.000000000","message":"Ack","commit_id":"8a0c1bea48448c814a392c5da3eef0483ced5e0f"}],"glance/tests/unit/test_image_cache.py":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"480ca82539c6f6ade515ea5c63b968ea249d6e3e","unresolved":true,"context_lines":[{"line_number":528,"context_line":"        store.create_multi_stores(CONF)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        tempf \u003d tempfile.NamedTemporaryFile()"},{"line_number":531,"context_line":"        tempf.write(b\u0027foo\u0027)"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        db \u003d unit_test_utils.FakeDB(initialize\u003dFalse)"},{"line_number":534,"context_line":"        mock_get_db.return_value \u003d db"}],"source_content_type":"text/x-python","patch_set":3,"id":"2d9fd79b_b4280e8a","line":531,"range":{"start_line":531,"start_character":26,"end_line":531,"end_character":27},"updated":"2021-09-14 16:15:04.000000000","message":"I think this is never closed, and will leave a file on the user\u0027s filesystem. Could we close it (or use it in a context: with NamedTemporaryFile() as tempf)?","commit_id":"9b385f7b671fd9994d416949ebd10c424d9fc072"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"90aa116f36568076b6728e7dcbd44fdb891ba46c","unresolved":true,"context_lines":[{"line_number":528,"context_line":"        store.create_multi_stores(CONF)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        tempf \u003d tempfile.NamedTemporaryFile()"},{"line_number":531,"context_line":"        tempf.write(b\u0027foo\u0027)"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        db \u003d unit_test_utils.FakeDB(initialize\u003dFalse)"},{"line_number":534,"context_line":"        mock_get_db.return_value \u003d db"}],"source_content_type":"text/x-python","patch_set":3,"id":"d32bff50_1a3b8ef0","line":531,"range":{"start_line":531,"start_character":26,"end_line":531,"end_character":27},"in_reply_to":"2d9fd79b_b4280e8a","updated":"2021-09-14 16:18:03.000000000","message":"may be something like self.addCleanup(tempf.close)","commit_id":"9b385f7b671fd9994d416949ebd10c424d9fc072"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"09e4e5e66902cd5ac6fe2ac7d7930ca324280f91","unresolved":true,"context_lines":[{"line_number":528,"context_line":"        store.create_multi_stores(CONF)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        tempf \u003d tempfile.NamedTemporaryFile()"},{"line_number":531,"context_line":"        tempf.write(b\u0027foo\u0027)"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        db \u003d unit_test_utils.FakeDB(initialize\u003dFalse)"},{"line_number":534,"context_line":"        mock_get_db.return_value \u003d db"}],"source_content_type":"text/x-python","patch_set":3,"id":"4a9c44a5_a95e9611","line":531,"range":{"start_line":531,"start_character":26,"end_line":531,"end_character":27},"in_reply_to":"7ff3d241_a1b4b882","updated":"2021-09-14 16:27:35.000000000","message":"Cool, thank you for example!","commit_id":"9b385f7b671fd9994d416949ebd10c424d9fc072"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"484db5d94d9ca73ea8bb35a1dd729fe7d7345b4f","unresolved":true,"context_lines":[{"line_number":528,"context_line":"        store.create_multi_stores(CONF)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        tempf \u003d tempfile.NamedTemporaryFile()"},{"line_number":531,"context_line":"        tempf.write(b\u0027foo\u0027)"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        db \u003d unit_test_utils.FakeDB(initialize\u003dFalse)"},{"line_number":534,"context_line":"        mock_get_db.return_value \u003d db"}],"source_content_type":"text/x-python","patch_set":3,"id":"7ff3d241_a1b4b882","line":531,"range":{"start_line":531,"start_character":26,"end_line":531,"end_character":27},"in_reply_to":"d32bff50_1a3b8ef0","updated":"2021-09-14 16:24:25.000000000","message":"No, it won\u0027t be left behind. The file will be closed when this goes out of scope (and is garbage collected), which deletes the file.\n\n Python 3.8.10 (default, Jun  2 2021, 10:49:15)\n [GCC 9.4.0] on linux\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more  information.\n \u003e\u003e\u003e import tempfile\n \u003e\u003e\u003e f \u003d tempfile.NamedTemporaryFile()\n \u003e\u003e\u003e f.name\n \u0027/tmp/tmpj8r1p1zc\u0027\n \u003e\u003e\u003e\n dan@guaranine:~$ ls /tmp/tmpj8r1p1zc\n ls: cannot access \u0027/tmp/tmpj8r1p1zc\u0027: No such file or directory","commit_id":"9b385f7b671fd9994d416949ebd10c424d9fc072"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"480ca82539c6f6ade515ea5c63b968ea249d6e3e","unresolved":true,"context_lines":[{"line_number":554,"context_line":"        image.disk_format \u003d \u0027raw\u0027"},{"line_number":555,"context_line":"        image.container_format \u003d \u0027bare\u0027"},{"line_number":556,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":557,"context_line":"        loc \u003d {\u0027url\u0027: \u0027file://%s\u0027 % tempf.name, \u0027metadata\u0027: {\u0027store\u0027: \u0027cheap\u0027}}"},{"line_number":558,"context_line":"        with mock.patch(\u0027glance.location._check_image_location\u0027):"},{"line_number":559,"context_line":"            # FIXME(danms): Why do I have to do this?"},{"line_number":560,"context_line":"            image.locations \u003d [loc]"}],"source_content_type":"text/x-python","patch_set":3,"id":"e3441b12_de1adc8d","line":557,"range":{"start_line":557,"start_character":8,"end_line":557,"end_character":11},"updated":"2021-09-14 16:15:04.000000000","message":"And maybe we could move the tempfile creation here, closer to where it is used.","commit_id":"9b385f7b671fd9994d416949ebd10c424d9fc072"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd4ded33c7dcdffd4f61c32d28b072248224cddb","unresolved":true,"context_lines":[{"line_number":554,"context_line":"        image.disk_format \u003d \u0027raw\u0027"},{"line_number":555,"context_line":"        image.container_format \u003d \u0027bare\u0027"},{"line_number":556,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":557,"context_line":"        loc \u003d {\u0027url\u0027: \u0027file://%s\u0027 % tempf.name, \u0027metadata\u0027: {\u0027store\u0027: \u0027cheap\u0027}}"},{"line_number":558,"context_line":"        with mock.patch(\u0027glance.location._check_image_location\u0027):"},{"line_number":559,"context_line":"            # FIXME(danms): Why do I have to do this?"},{"line_number":560,"context_line":"            image.locations \u003d [loc]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3df57fc7_77c41e08","line":557,"range":{"start_line":557,"start_character":8,"end_line":557,"end_character":11},"in_reply_to":"e3441b12_de1adc8d","updated":"2021-09-14 16:28:49.000000000","message":"I was trying to do all my setup early, so that the sequence of actual changes is easier to follow (create, attempt to cache, give it a location, attempt to cache)","commit_id":"9b385f7b671fd9994d416949ebd10c424d9fc072"}]}
