)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"d234c763f92ab705edd045a62accb5676a74afc6","unresolved":true,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Co-Author: Dan Smith \u003cdms@danplanet.com\u003e"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Implements: blueprint instant_caching"},{"line_number":20,"context_line":"Change-Id: I9ab3f1b7595e22dbb03af95168314352a44eb930"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"a86839f9_315d0288","line":19,"range":{"start_line":19,"start_character":22,"end_line":19,"end_character":37},"updated":"2022-07-18 14:57:48.000000000","message":"nit: instant-caching","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11adeaf1c8e7f7b69acfa5535c16cd4ddbcf50e4","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Co-Author: Dan Smith \u003cdms@danplanet.com\u003e"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Implements: blueprint instant_caching"},{"line_number":20,"context_line":"Change-Id: I9ab3f1b7595e22dbb03af95168314352a44eb930"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"f0f0f1ad_9035c34c","line":19,"range":{"start_line":19,"start_character":22,"end_line":19,"end_character":37},"in_reply_to":"a86839f9_315d0288","updated":"2022-07-18 16:39:41.000000000","message":"Done","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"43a9079b56b28e2a7df05680462a9d47d734ca1b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"8dbecdad_2046309e","updated":"2022-05-17 09:47:17.000000000","message":"Initial PoC for immediate caching of an image!","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e77266b8b5564a378617ff927227567a1638d32c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"517e777f_f89c223b","updated":"2022-05-17 14:16:11.000000000","message":"Just some initial thoughts... thanks for getting started on this :)","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"659d6bbef5db61556ec50aa3b58b3601d7ba9d06","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"8822853e_f4815a1f","updated":"2022-06-10 17:14:11.000000000","message":"Abhi, I\u0027m going to push up some changes on top of this to help clarify. Since this is very WIP and looking for direction feedback, I assume that\u0027s okay. My changes are untested, but so are the ones here (AFAIK) so I assume I\u0027m not breaking anything. Happy to help get these into shape next week, but I figure this is the easiest way to push a model forward for discussion.","commit_id":"914b56a94729e18de8b35c099f9255c33d523e18"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2dedff3d9f038afa90b597534ff00d667df136a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"c92e1993_b1f587f6","updated":"2022-06-13 09:08:06.000000000","message":"Thank you Dan for the inputs and clean design!","commit_id":"39981c88b992250e66efd7a8ef3f60eddc1f0415"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f4c731ee169432c1125673be70159c6d418e0e7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"dc2d3998_0ca519b0","updated":"2022-06-14 13:25:10.000000000","message":"Added some todo points to addressed in follow up patch;\nDocument new behavior of caching and remove usage of periodic job from the documentation.","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4b49db24d72656000a79992851498b0b97207aeb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"9cd6debe_9f5500c1","updated":"2022-07-06 06:02:00.000000000","message":"Hi Dan,\nThank you for your inputs, added one inline comment and need some clarification on unit test change which we can discuss once you are back.\n\nThank you for review!\n","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"10ebdc402756edf64d955c91556e82c955517737","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"d6cad65e_d8f9cb2c","updated":"2022-07-05 14:14:17.000000000","message":"Looking pretty good, just a few issues and comments","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"489fd9d92c6927783c1e024803bfbe6e9c9a8e62","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"3b338472_b2632adc","updated":"2022-07-12 06:40:01.000000000","message":"Thank you for inputs Dan!","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"852edece2711573b5244fe329fef93f4e0ebf40c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"62acc273_c452f22d","updated":"2022-06-21 06:16:35.000000000","message":"Updated tempest coverage,\n\nhttps://review.opendev.org/c/openstack/tempest/+/825112","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ccb2f805c323665254dc082814f6bfdf48d9f399","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"77e57b2f_ca535603","updated":"2022-06-21 15:24:21.000000000","message":"recheck fips functional failure","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cfb62a7544df72d7a723f5518ecfe22b64eb24f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"215cc5e4_0c664676","updated":"2022-06-24 05:34:45.000000000","message":"recheck fips issue fixed","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"104c67707cfcc1d47125eee90cb0448bd5fd64ee","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"9d76587f_cdde953b","updated":"2022-06-21 05:57:03.000000000","message":"recheck non related failure\n","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5a23cf043c71c051b043aa786c81ec9f793910ec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"351a52f2_3ea58f02","updated":"2022-07-15 15:27:16.000000000","message":"One more thing on the tests but I think this is looking good.. I want to go look at the tempest stuff too.","commit_id":"76570684caf6083e517f88c20d6485b3fac284bd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"316896730a1a8c61b6e2918831c8ae5ac831a8ab","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"838018c0_d4791ebb","updated":"2022-07-18 06:12:39.000000000","message":"As a Co-Author I am entitled to vote for +1 only.\nThank you Dan!","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"e757d8d04ab003c84fa2e1d95da76177332c0e93","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"b4cd28ca_8f99ca02","updated":"2022-07-18 16:28:50.000000000","message":"Forgot to vote.  Just a few typos, otherwise everything looks OK.","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"d234c763f92ab705edd045a62accb5676a74afc6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"9f2016db_72e38460","updated":"2022-07-18 14:57:48.000000000","message":"LGTM on an initial look; a few typos noted inline.  Have not finished reviewing the tests yet. ","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"91393c4742248969e485e1c758040362d4caddf3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"577e962a_d6d787dc","updated":"2022-07-18 16:27:41.000000000","message":"One more typo, otherwise looks fine.","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11adeaf1c8e7f7b69acfa5535c16cd4ddbcf50e4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"3717a7b4_141c1256","updated":"2022-07-18 16:39:41.000000000","message":"Thank you Brian for review, made changes as per your suggestion!","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"21272bfd2651b0ca6f2118f009e5f6eb5aa595ff","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"0e0f19ef_133f127b","updated":"2022-07-15 16:10:48.000000000","message":"Thank you for the test Dan!","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"c5becc1ca1f1f5583b0503a2501007528b22553f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"cced28cf_8daff227","updated":"2022-07-19 12:07:43.000000000","message":"Code looks fine and has good test coverage.","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"84e3ed853750c92e4e573fd6fc227af2ca7b9659","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"626cff82_53272fdf","updated":"2022-07-19 14:23:14.000000000","message":"Not against it, but I have a couple of questions before we merge.","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"3786095cecff1745bd12282395386035b35703de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"a3a9f567_799a0a55","updated":"2022-07-19 15:30:45.000000000","message":"Thanks to you both for your quick answers!","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"}],"doc/source/admin/cache.rst":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"d234c763f92ab705edd045a62accb5676a74afc6","unresolved":true,"context_lines":[{"line_number":137,"context_line":"  the size of the image, and the times they were last accessed as well as"},{"line_number":138,"context_line":"  images which are queued for caching."},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"* Alternately, you can use the can use the ``cache-list`` command of glance"},{"line_number":141,"context_line":"  client. Example usage::"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"   $ glance cache-list"}],"source_content_type":"text/x-rst","patch_set":11,"id":"0034f8f1_d5eb1b0b","line":140,"range":{"start_line":140,"start_character":31,"end_line":140,"end_character":42},"updated":"2022-07-18 14:57:48.000000000","message":"delete repetition","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11adeaf1c8e7f7b69acfa5535c16cd4ddbcf50e4","unresolved":false,"context_lines":[{"line_number":137,"context_line":"  the size of the image, and the times they were last accessed as well as"},{"line_number":138,"context_line":"  images which are queued for caching."},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"* Alternately, you can use the can use the ``cache-list`` command of glance"},{"line_number":141,"context_line":"  client. Example usage::"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"   $ glance cache-list"}],"source_content_type":"text/x-rst","patch_set":11,"id":"27a81d29_0a859ded","line":140,"range":{"start_line":140,"start_character":31,"end_line":140,"end_character":42},"in_reply_to":"0034f8f1_d5eb1b0b","updated":"2022-07-18 16:39:41.000000000","message":"Done","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"d234c763f92ab705edd045a62accb5676a74afc6","unresolved":true,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"  $ glance cache-delete \u003cIMAGE_ID\u003e"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"* You can also cll ``DELETE /cache`` with header ``x-image-cache-clear-target``"},{"line_number":157,"context_line":"  to delete either only cached images or only queued images or both. Possible"},{"line_number":158,"context_line":"  values for header are ``cache``, ``queue``, ``both``."},{"line_number":159,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"f2022c02_2aa0d228","line":156,"range":{"start_line":156,"start_character":15,"end_line":156,"end_character":18},"updated":"2022-07-18 14:57:48.000000000","message":"call","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11adeaf1c8e7f7b69acfa5535c16cd4ddbcf50e4","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"  $ glance cache-delete \u003cIMAGE_ID\u003e"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"* You can also cll ``DELETE /cache`` with header ``x-image-cache-clear-target``"},{"line_number":157,"context_line":"  to delete either only cached images or only queued images or both. Possible"},{"line_number":158,"context_line":"  values for header are ``cache``, ``queue``, ``both``."},{"line_number":159,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"e919554d_8a1eb57a","line":156,"range":{"start_line":156,"start_character":15,"end_line":156,"end_character":18},"in_reply_to":"f2022c02_2aa0d228","updated":"2022-07-18 16:39:41.000000000","message":"Done","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"}],"glance/api/v2/cached_images.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e77266b8b5564a378617ff927227567a1638d32c","unresolved":true,"context_lines":[{"line_number":40,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class CacheController(object):"},{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    A controller for managing cached images."},{"line_number":46,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"ad898620_cc8ee15e","line":43,"updated":"2022-05-17 14:16:11.000000000","message":"Is this the right place to do this? I think we want to make sure there is only one caching thread per system, right? I guess I need to go look at how this is done today, but I think we want to be sure that we\u0027re not spawning N caching workers on a single node and letting them all run in parallel. Or, is there already a system-wide lock somewhere deeper?","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d15b153be28634742480bb8c5fb179941af47399","unresolved":false,"context_lines":[{"line_number":40,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class CacheController(object):"},{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    A controller for managing cached images."},{"line_number":46,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"0d14b5f0_58b2e2aa","line":43,"in_reply_to":"ad898620_cc8ee15e","updated":"2022-06-13 09:07:46.000000000","message":"Ack","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e77266b8b5564a378617ff927227567a1638d32c","unresolved":true,"context_lines":[{"line_number":63,"context_line":"        from glance.image_cache import prefetcher  # noqa"},{"line_number":64,"context_line":"        self.prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":65,"context_line":"        self.cache_queue \u003d queue.Queue()"},{"line_number":66,"context_line":"        self.cache_pool \u003d api_common.get_thread_pool(\u0027prefetcher\u0027)"},{"line_number":67,"context_line":"        self.cache_pool.spawn(self.instant_caching, self.cache_queue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def instant_caching(self, cache_queue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"03dcf53c_ca0ecd06","line":66,"updated":"2022-05-17 14:16:11.000000000","message":"I wonder if we really want to do this? We only need one caching thread, so no pool strictly required. Also, in the case of the eventlet execution, we might want this to run in a real thread anyway, so that we don\u0027t impact the performance of our regular activities. The caching should be totally IO-bound, so eventlet *should* work fine I think, but it might be worth considering using a regular thread always.","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d15b153be28634742480bb8c5fb179941af47399","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        from glance.image_cache import prefetcher  # noqa"},{"line_number":64,"context_line":"        self.prefetcher \u003d prefetcher.Prefetcher()"},{"line_number":65,"context_line":"        self.cache_queue \u003d queue.Queue()"},{"line_number":66,"context_line":"        self.cache_pool \u003d api_common.get_thread_pool(\u0027prefetcher\u0027)"},{"line_number":67,"context_line":"        self.cache_pool.spawn(self.instant_caching, self.cache_queue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def instant_caching(self, cache_queue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1b676c7b_817a121e","line":66,"in_reply_to":"03dcf53c_ca0ecd06","updated":"2022-06-13 09:07:46.000000000","message":"Ack","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e77266b8b5564a378617ff927227567a1638d32c","unresolved":true,"context_lines":[{"line_number":67,"context_line":"        self.cache_pool.spawn(self.instant_caching, self.cache_queue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def instant_caching(self, cache_queue):"},{"line_number":70,"context_line":"        while True:"},{"line_number":71,"context_line":"            image_id \u003d cache_queue.get()"},{"line_number":72,"context_line":"            self.prefetcher.fetch_image_into_cache(image_id)"},{"line_number":73,"context_line":"            cache_queue.task_done()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3dae8d87_ff6c59d6","line":70,"updated":"2022-05-17 14:16:11.000000000","message":"You need to do one of two things, either:\n\n 1. Set daemon\u003dTrue on the thread before you start it. This will \n    cause the thread to die immediately if the parent process is \n    exiting. This is how the cache thread is spawned in wsgi_app.py \n    right now.\n\n 2. Have some sort of signal (maybe threading.Event) that this\n    blocks on, or a sentinel you send down the queue, to cause this \n    loop to break. Otherwise this will continue running in the \n    background and keep us from existing without SIGKILL.","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3e9dfc458f1f0911a31d78fa8c470334d53b27ef","unresolved":true,"context_lines":[{"line_number":67,"context_line":"        self.cache_pool.spawn(self.instant_caching, self.cache_queue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def instant_caching(self, cache_queue):"},{"line_number":70,"context_line":"        while True:"},{"line_number":71,"context_line":"            image_id \u003d cache_queue.get()"},{"line_number":72,"context_line":"            self.prefetcher.fetch_image_into_cache(image_id)"},{"line_number":73,"context_line":"            cache_queue.task_done()"}],"source_content_type":"text/x-python","patch_set":1,"id":"b2e9c941_ef064bd6","line":70,"in_reply_to":"3dae8d87_ff6c59d6","updated":"2022-05-17 14:38:32.000000000","message":"I can exit/break when queue is empty.\nIf I create object of normal thread and set it to True as daemon before starting the operation does not remain async and the client needs to wait until the operation completes/ i.e. it waits until image is cached completely.\n\n(I will try to do it once again)","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d15b153be28634742480bb8c5fb179941af47399","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.cache_pool.spawn(self.instant_caching, self.cache_queue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def instant_caching(self, cache_queue):"},{"line_number":70,"context_line":"        while True:"},{"line_number":71,"context_line":"            image_id \u003d cache_queue.get()"},{"line_number":72,"context_line":"            self.prefetcher.fetch_image_into_cache(image_id)"},{"line_number":73,"context_line":"            cache_queue.task_done()"}],"source_content_type":"text/x-python","patch_set":1,"id":"29ebe238_9226959b","line":70,"in_reply_to":"6b9986b2_b8eb20b1","updated":"2022-06-13 09:07:46.000000000","message":"Ack","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fc3266ebdae30c5648770bfcf8261823c545795a","unresolved":true,"context_lines":[{"line_number":67,"context_line":"        self.cache_pool.spawn(self.instant_caching, self.cache_queue)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def instant_caching(self, cache_queue):"},{"line_number":70,"context_line":"        while True:"},{"line_number":71,"context_line":"            image_id \u003d cache_queue.get()"},{"line_number":72,"context_line":"            self.prefetcher.fetch_image_into_cache(image_id)"},{"line_number":73,"context_line":"            cache_queue.task_done()"}],"source_content_type":"text/x-python","patch_set":1,"id":"6b9986b2_b8eb20b1","line":70,"in_reply_to":"b2e9c941_ef064bd6","updated":"2022-05-17 14:49:56.000000000","message":"\u003e I can exit/break when queue is empty.\n\nI don\u0027t think you want to do that, do you? The queue is empty almost all of the time, but the worker should block on the queue waiting for the next thing. What you want is to signal the thread to exit (if non-daemon) explicitly. A common way to do this is to use a sentinel:\n\n  exit_sentinel \u003d object()\n  ...\n  # on exit, send the sentinel to the worker\n  queue.put(exit_sentinel)\n\n and then in the worker:\n\n task \u003d queue.get()\n if task \u003d\u003d exit_sentinel:\n     break\n\n\u003e If I create object of normal thread and set it to True as daemon before starting the operation does not remain async and the client needs to wait until the operation completes/ i.e. it waits until image is cached completely.\n\nI\u0027m not sure what you mean here. The daemon flag on the thread only affects what happens to the thread when the main process exits. If it\u0027s true, then the thread is killed immediately, and if it\u0027s false, the main process blocks on exit until the thread finishes.\n\nYou could argue that we should signal the thread to exit, and then wait for it to finish its current task before doing so. However, it would be frustrating for an operator to need to do an upgrade or patch of glance and have to wait many minutes for it to finish a cache operation before exit.","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e77266b8b5564a378617ff927227567a1638d32c","unresolved":true,"context_lines":[{"line_number":249,"context_line":"        self.cache.queue_image(image_id)"},{"line_number":250,"context_line":"        self.cache_queue.put(image_id)"},{"line_number":251,"context_line":"        LOG.debug(\"Caching queue size at this moment is %d\","},{"line_number":252,"context_line":"                  self.cache_queue.qsize())"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"class CachedImageDeserializer(wsgi.JSONRequestDeserializer):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5b26e2b7_18039626","line":252,"updated":"2022-05-17 14:16:11.000000000","message":"I would also put some debug in the caching thread loop as well, so you can see when it\u0027s submitted and when it is being processed/finished. Especially for verifying in gate jobs that it\u0027s happening and completing...","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3e9dfc458f1f0911a31d78fa8c470334d53b27ef","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        self.cache.queue_image(image_id)"},{"line_number":250,"context_line":"        self.cache_queue.put(image_id)"},{"line_number":251,"context_line":"        LOG.debug(\"Caching queue size at this moment is %d\","},{"line_number":252,"context_line":"                  self.cache_queue.qsize())"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"class CachedImageDeserializer(wsgi.JSONRequestDeserializer):"}],"source_content_type":"text/x-python","patch_set":1,"id":"49cdb769_59eff2b1","line":252,"in_reply_to":"5b26e2b7_18039626","updated":"2022-05-17 14:38:32.000000000","message":"Ack","commit_id":"9466ab9734d4f18cdf31af9fb5ec40f826de2cf6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"659d6bbef5db61556ec50aa3b58b3601d7ba9d06","unresolved":true,"context_lines":[{"line_number":245,"context_line":"        cache_queue.put(exit_sentinel)"},{"line_number":246,"context_line":"        LOG.debug(\"Caching queue size at this moment is %d\","},{"line_number":247,"context_line":"                  cache_queue.qsize())"},{"line_number":248,"context_line":"        CacheWorker(cache_queue, self.prefetcher, exit_sentinel).start()"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class CacheWorker(threading.Thread):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f82565c_546c6c20","line":248,"updated":"2022-06-10 17:14:11.000000000","message":"I think maybe my feedback got a little confused. This is creating a new queue and thread for each request, which means we could end up with a bunch of parallel competing threads, all processing a queue of a single item (followed by the inevitable exit sentinel). That\u0027s not what I intended.\n\nI think we should:\n\n1. Create one queue\n2. Create one worker thread that processes that queue\n3. Submit jobs to the queue when the API call comes in\n4. Submit the exit sentinel to the thread when we need it to stop\n5. Run join() to make sure it exits before we do","commit_id":"914b56a94729e18de8b35c099f9255c33d523e18"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d15b153be28634742480bb8c5fb179941af47399","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        cache_queue.put(exit_sentinel)"},{"line_number":246,"context_line":"        LOG.debug(\"Caching queue size at this moment is %d\","},{"line_number":247,"context_line":"                  cache_queue.qsize())"},{"line_number":248,"context_line":"        CacheWorker(cache_queue, self.prefetcher, exit_sentinel).start()"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class CacheWorker(threading.Thread):"}],"source_content_type":"text/x-python","patch_set":2,"id":"dadebad2_ae20d7ae","line":248,"in_reply_to":"1f82565c_546c6c20","updated":"2022-06-13 09:07:46.000000000","message":"Made some changes and verified it works functionally. Also fixed functional tests accordingly.","commit_id":"914b56a94729e18de8b35c099f9255c33d523e18"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b505f77c24cd4c13c00212a574f9010d926a56be","unresolved":true,"context_lines":[{"line_number":249,"context_line":"class CacheWorker(threading.Thread):"},{"line_number":250,"context_line":"    EXIT_SENTINEL \u003d object()"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":253,"context_line":"        self.q \u003d queue.Queue()"},{"line_number":254,"context_line":"        # NOTE(abhishekk): Importing the prefetcher just in time to avoid"},{"line_number":255,"context_line":"        # import loop during initialization"}],"source_content_type":"text/x-python","patch_set":7,"id":"226029d8_44b09410","line":252,"updated":"2022-06-16 05:22:03.000000000","message":"DO we need to set it as daemon as well?","commit_id":"337ecb34bca64dccd4b9b6b4340e19aac6737956"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cca63055aac34b591229eed832697e2e87aeaa34","unresolved":true,"context_lines":[{"line_number":249,"context_line":"class CacheWorker(threading.Thread):"},{"line_number":250,"context_line":"    EXIT_SENTINEL \u003d object()"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":253,"context_line":"        self.q \u003d queue.Queue()"},{"line_number":254,"context_line":"        # NOTE(abhishekk): Importing the prefetcher just in time to avoid"},{"line_number":255,"context_line":"        # import loop during initialization"}],"source_content_type":"text/x-python","patch_set":7,"id":"49a11c06_b5eb54d3","line":252,"in_reply_to":"226029d8_44b09410","updated":"2022-06-16 13:30:45.000000000","message":"Daemon will make it exit with no warning if the main thread does. If you\u0027re still making the main thread signal and wait, then it doesn\u0027t matter.","commit_id":"337ecb34bca64dccd4b9b6b4340e19aac6737956"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"858762174a3c45dca8d0646b74ef783885fb9793","unresolved":false,"context_lines":[{"line_number":249,"context_line":"class CacheWorker(threading.Thread):"},{"line_number":250,"context_line":"    EXIT_SENTINEL \u003d object()"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":253,"context_line":"        self.q \u003d queue.Queue()"},{"line_number":254,"context_line":"        # NOTE(abhishekk): Importing the prefetcher just in time to avoid"},{"line_number":255,"context_line":"        # import loop during initialization"}],"source_content_type":"text/x-python","patch_set":7,"id":"8845ed20_2de3ad2b","line":252,"in_reply_to":"49a11c06_b5eb54d3","updated":"2022-06-20 14:43:40.000000000","message":"Ack","commit_id":"337ecb34bca64dccd4b9b6b4340e19aac6737956"}],"glance/common/wsgi.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cca63055aac34b591229eed832697e2e87aeaa34","unresolved":true,"context_lines":[{"line_number":569,"context_line":"        if cached_images.WORKER:"},{"line_number":570,"context_line":"            # If we started a cache worker, signal it to exit"},{"line_number":571,"context_line":"            # and wait until it does."},{"line_number":572,"context_line":"            cached_images.WORKER.terminate()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _single_run(self, application, sock):"},{"line_number":575,"context_line":"        \"\"\"Start a WSGI server in a new green thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"d5f56efc_6482db36","line":572,"updated":"2022-06-16 13:30:45.000000000","message":"Regarding the graceful exit conversation:\n\nI think probably the best thing to do is something I suggested earlier in this process, which is to make caching interruptible. That would mean we write to ${image_id}.tmp until complete and then we atomically rename ${image_id}.tmp to ${image_id} once we know it\u0027s done. On startup, we clean up any partial *.tmp files we might have left over from a previous attempt.\n\nThe other option would be to fork a cache worker process that we communicate with over a pipe and which dies with us, but I think it will be difficult to make that a true singleton amongst the workers that uwsgi forks for us. And of course, it\u0027s much more complicated.","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f1b00e1e6a86b2e5b8eead89e5922a924da200d2","unresolved":true,"context_lines":[{"line_number":569,"context_line":"        if cached_images.WORKER:"},{"line_number":570,"context_line":"            # If we started a cache worker, signal it to exit"},{"line_number":571,"context_line":"            # and wait until it does."},{"line_number":572,"context_line":"            cached_images.WORKER.terminate()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _single_run(self, application, sock):"},{"line_number":575,"context_line":"        \"\"\"Start a WSGI server in a new green thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1fe9e330_4ad1b63b","line":572,"in_reply_to":"0c66c570_642d1f0e","updated":"2022-06-16 14:40:39.000000000","message":"Okay, but presumably not cleaning them up? But regardless, I think not holding up process exit for caching is probably the right thing to do. It would suck if there\u0027s a big queue of images to cache preventing you from restarting glance to apply an update. Caching is non-critical.\n\nFor the same point, an operator trying to shut down and having to wait a long time for glance to shut down because some user is downloading an image over dial-up would suck too. If we\u0027re doing a SIGHUP restart it makes sense to not drop that transfer, but waiting hours probably isn\u0027t good either.","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a342d1b5fb2e909e5434b5c95b13e9cab2d515fc","unresolved":true,"context_lines":[{"line_number":569,"context_line":"        if cached_images.WORKER:"},{"line_number":570,"context_line":"            # If we started a cache worker, signal it to exit"},{"line_number":571,"context_line":"            # and wait until it does."},{"line_number":572,"context_line":"            cached_images.WORKER.terminate()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _single_run(self, application, sock):"},{"line_number":575,"context_line":"        \"\"\"Start a WSGI server in a new green thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"b911efad_39b80c32","line":572,"in_reply_to":"1fe9e330_4ad1b63b","updated":"2022-06-16 17:21:54.000000000","message":"Right, we do not clean it on startup or anytime. Agree to not hold process to exit for caching.","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"858762174a3c45dca8d0646b74ef783885fb9793","unresolved":false,"context_lines":[{"line_number":569,"context_line":"        if cached_images.WORKER:"},{"line_number":570,"context_line":"            # If we started a cache worker, signal it to exit"},{"line_number":571,"context_line":"            # and wait until it does."},{"line_number":572,"context_line":"            cached_images.WORKER.terminate()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _single_run(self, application, sock):"},{"line_number":575,"context_line":"        \"\"\"Start a WSGI server in a new green thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9449aa12_230bdd03","line":572,"in_reply_to":"b911efad_39b80c32","updated":"2022-06-20 14:43:40.000000000","message":"Done","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1246f5766b57705d7d2d999cb59c306f2db02c24","unresolved":true,"context_lines":[{"line_number":569,"context_line":"        if cached_images.WORKER:"},{"line_number":570,"context_line":"            # If we started a cache worker, signal it to exit"},{"line_number":571,"context_line":"            # and wait until it does."},{"line_number":572,"context_line":"            cached_images.WORKER.terminate()"},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"    def _single_run(self, application, sock):"},{"line_number":575,"context_line":"        \"\"\"Start a WSGI server in a new green thread.\"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"0c66c570_642d1f0e","line":572,"in_reply_to":"d5f56efc_6482db36","updated":"2022-06-16 14:00:16.000000000","message":"AFAIK we are doing the same right now, instead of storing it as tmp file we are caching the file in incomplete directory under cache folder for example for devstack the path will be /opt/stack/data/glance/cache/incomplete folder and once caching is complete we move it to upper directory.","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f4c731ee169432c1125673be70159c6d418e0e7","unresolved":true,"context_lines":[{"line_number":269,"context_line":"                    \u0027used for inter-process communication.\u0027),"},{"line_number":270,"context_line":"]"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"cache_opts \u003d ["},{"line_number":273,"context_line":"    cfg.FloatOpt(\u0027cache_prefetcher_interval\u0027,"},{"line_number":274,"context_line":"                 default\u003d300,"},{"line_number":275,"context_line":"                 help\u003d_(\"\"\""},{"line_number":276,"context_line":"The interval in seconds to run periodic job cache_images."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"The cache_images method will fetch all images which are in queued state"},{"line_number":279,"context_line":"for caching in cache directory. The default value is 300."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"Possible values:"},{"line_number":282,"context_line":"    * Positive integer"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"Related options:"},{"line_number":285,"context_line":"    * None"},{"line_number":286,"context_line":"\"\"\"))"},{"line_number":287,"context_line":"]"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"d687abfe_176a4c1c","line":287,"range":{"start_line":272,"start_character":0,"end_line":287,"end_character":1},"updated":"2022-06-14 13:25:10.000000000","message":"TODO: Need to remove this as well","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                    \u0027used for inter-process communication.\u0027),"},{"line_number":270,"context_line":"]"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"cache_opts \u003d ["},{"line_number":273,"context_line":"    cfg.FloatOpt(\u0027cache_prefetcher_interval\u0027,"},{"line_number":274,"context_line":"                 default\u003d300,"},{"line_number":275,"context_line":"                 help\u003d_(\"\"\""},{"line_number":276,"context_line":"The interval in seconds to run periodic job cache_images."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"The cache_images method will fetch all images which are in queued state"},{"line_number":279,"context_line":"for caching in cache directory. The default value is 300."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"Possible values:"},{"line_number":282,"context_line":"    * Positive integer"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"Related options:"},{"line_number":285,"context_line":"    * None"},{"line_number":286,"context_line":"\"\"\"))"},{"line_number":287,"context_line":"]"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"ff591059_ef473b53","line":287,"range":{"start_line":272,"start_character":0,"end_line":287,"end_character":1},"in_reply_to":"d687abfe_176a4c1c","updated":"2022-06-15 08:24:50.000000000","message":"Done","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"9eab077b7d85034d2414d63d7a067e0e463dc97d","unresolved":true,"context_lines":[{"line_number":269,"context_line":"                    \u0027used for inter-process communication.\u0027),"},{"line_number":270,"context_line":"]"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"cache_opts \u003d ["},{"line_number":273,"context_line":"    cfg.FloatOpt(\u0027cache_prefetcher_interval\u0027,"},{"line_number":274,"context_line":"                 default\u003d300,"},{"line_number":275,"context_line":"                 help\u003d_(\"\"\""},{"line_number":276,"context_line":"The interval in seconds to run periodic job cache_images."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"The cache_images method will fetch all images which are in queued state"},{"line_number":279,"context_line":"for caching in cache directory. The default value is 300."},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"Possible values:"},{"line_number":282,"context_line":"    * Positive integer"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"Related options:"},{"line_number":285,"context_line":"    * None"},{"line_number":286,"context_line":"\"\"\"))"},{"line_number":287,"context_line":"]"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":290,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bed0dcbc_b203e0ea","line":287,"range":{"start_line":272,"start_character":0,"end_line":287,"end_character":1},"in_reply_to":"ff591059_ef473b53","updated":"2022-09-07 14:47:37.000000000","message":"I really hope this was not removed, but deprecated and kept for one cycle so that users can more easily notice the parameter has no effect and is being removed.","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f4c731ee169432c1125673be70159c6d418e0e7","unresolved":true,"context_lines":[{"line_number":434,"context_line":"    glance store needs to be initialized."},{"line_number":435,"context_line":"    \"\"\""},{"line_number":436,"context_line":"    def __init__(self, threads\u003d1000, initialize_glance_store\u003dFalse,"},{"line_number":437,"context_line":"                 initialize_prefetcher\u003dFalse):"},{"line_number":438,"context_line":"        os.umask(0o27)  # ensure files are created with the correct privileges"},{"line_number":439,"context_line":"        self._logger \u003d logging.getLogger(\"eventlet.wsgi.server\")"},{"line_number":440,"context_line":"        self.threads \u003d threads"}],"source_content_type":"text/x-python","patch_set":6,"id":"044bda6a_7731fc6d","line":437,"range":{"start_line":437,"start_character":17,"end_line":437,"end_character":44},"updated":"2022-06-14 13:25:10.000000000","message":"ToDo: Remove this and line 446","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    glance store needs to be initialized."},{"line_number":435,"context_line":"    \"\"\""},{"line_number":436,"context_line":"    def __init__(self, threads\u003d1000, initialize_glance_store\u003dFalse,"},{"line_number":437,"context_line":"                 initialize_prefetcher\u003dFalse):"},{"line_number":438,"context_line":"        os.umask(0o27)  # ensure files are created with the correct privileges"},{"line_number":439,"context_line":"        self._logger \u003d logging.getLogger(\"eventlet.wsgi.server\")"},{"line_number":440,"context_line":"        self.threads \u003d threads"}],"source_content_type":"text/x-python","patch_set":6,"id":"f65861c8_17f85d8b","line":437,"range":{"start_line":437,"start_character":17,"end_line":437,"end_character":44},"in_reply_to":"044bda6a_7731fc6d","updated":"2022-06-15 08:24:50.000000000","message":"Done","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"10ebdc402756edf64d955c91556e82c955517737","unresolved":true,"context_lines":[{"line_number":762,"context_line":"        # Ensure any logging config changes are picked up"},{"line_number":763,"context_line":"        logging.setup(CONF, \u0027glance\u0027)"},{"line_number":764,"context_line":"        config.set_config_defaults()"},{"line_number":765,"context_line":""},{"line_number":766,"context_line":"        self.configure(old_conf, has_changed)"},{"line_number":767,"context_line":"        self.start_wsgi()"},{"line_number":768,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"aaa5f32d_68203ed0","side":"PARENT","line":765,"updated":"2022-07-05 14:14:17.000000000","message":"Random whitespace damage.","commit_id":"ebef97d776eb1982b948658eaf20566853dc70a9"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4b49db24d72656000a79992851498b0b97207aeb","unresolved":false,"context_lines":[{"line_number":762,"context_line":"        # Ensure any logging config changes are picked up"},{"line_number":763,"context_line":"        logging.setup(CONF, \u0027glance\u0027)"},{"line_number":764,"context_line":"        config.set_config_defaults()"},{"line_number":765,"context_line":""},{"line_number":766,"context_line":"        self.configure(old_conf, has_changed)"},{"line_number":767,"context_line":"        self.start_wsgi()"},{"line_number":768,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"407b971d_53022b5c","side":"PARENT","line":765,"in_reply_to":"aaa5f32d_68203ed0","updated":"2022-07-06 06:02:00.000000000","message":"Done","commit_id":"ebef97d776eb1982b948658eaf20566853dc70a9"}],"glance/common/wsgi_app.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1f4c731ee169432c1125673be70159c6d418e0e7","unresolved":true,"context_lines":[{"line_number":118,"context_line":"    # NOTE(danms): We are running inside uwsgi or mod_wsgi, so no eventlet;"},{"line_number":119,"context_line":"    # use native threading instead."},{"line_number":120,"context_line":"    glance.async_.set_threadpool_model(\u0027native\u0027)"},{"line_number":121,"context_line":"    atexit.register(drain_workers)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    # NOTE(danms): Change the default threadpool size since we"},{"line_number":124,"context_line":"    # are dealing with native threads and not greenthreads."}],"source_content_type":"text/x-python","patch_set":6,"id":"810cda4e_835b3af0","line":121,"range":{"start_line":121,"start_character":4,"end_line":121,"end_character":19},"updated":"2022-06-14 13:25:10.000000000","message":"ToDo: use uwsgi.atexit","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":false,"context_lines":[{"line_number":118,"context_line":"    # NOTE(danms): We are running inside uwsgi or mod_wsgi, so no eventlet;"},{"line_number":119,"context_line":"    # use native threading instead."},{"line_number":120,"context_line":"    glance.async_.set_threadpool_model(\u0027native\u0027)"},{"line_number":121,"context_line":"    atexit.register(drain_workers)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    # NOTE(danms): Change the default threadpool size since we"},{"line_number":124,"context_line":"    # are dealing with native threads and not greenthreads."}],"source_content_type":"text/x-python","patch_set":6,"id":"2faedb0c_6ff42bee","line":121,"range":{"start_line":121,"start_character":4,"end_line":121,"end_character":19},"in_reply_to":"810cda4e_835b3af0","updated":"2022-06-15 08:24:50.000000000","message":"Done","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"10ebdc402756edf64d955c91556e82c955517737","unresolved":true,"context_lines":[{"line_number":126,"context_line":"    # use native threading instead."},{"line_number":127,"context_line":"    glance.async_.set_threadpool_model(\u0027native\u0027)"},{"line_number":128,"context_line":"    if uwsgi:"},{"line_number":129,"context_line":"        uwsgi.atexit \u003d drain_workers"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    # NOTE(danms): Change the default threadpool size since we"},{"line_number":132,"context_line":"    # are dealing with native threads and not greenthreads."}],"source_content_type":"text/x-python","patch_set":9,"id":"ec7e3cb0_f540e926","line":129,"updated":"2022-07-05 14:14:17.000000000","message":"This will only work for uwsgi and not something like gunicorn or mod_wsgi. I wonder if we should try to determine if we\u0027re non-standalone, but running under a wagi container, and if so, mark the thread as daemon so it won\u0027t hold us up from exiting? Alternately we could add a config option for \"don\u0027t try to exit caching cleanly, just stop immediately\"","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"53e626481189bf2ca6bb2cb3aea320358766048f","unresolved":true,"context_lines":[{"line_number":126,"context_line":"    # use native threading instead."},{"line_number":127,"context_line":"    glance.async_.set_threadpool_model(\u0027native\u0027)"},{"line_number":128,"context_line":"    if uwsgi:"},{"line_number":129,"context_line":"        uwsgi.atexit \u003d drain_workers"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    # NOTE(danms): Change the default threadpool size since we"},{"line_number":132,"context_line":"    # are dealing with native threads and not greenthreads."}],"source_content_type":"text/x-python","patch_set":9,"id":"86fd13de_c119e48f","line":129,"in_reply_to":"39b8d60f_b4761b77","updated":"2022-07-11 18:22:02.000000000","message":"I think that else part would be good at a minimum, perhaps with a LOG.warning() that we might not be doing the right thing.\n\nI also think it\u0027d be best to make the thread daemon\u003dTrue so that in the worst case if our atexit is not called, at least we don\u0027t hang waiting for a thread that will never exit. Either do that always (probably fine) or only do it if import uwsgi fails.","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"489fd9d92c6927783c1e024803bfbe6e9c9a8e62","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    # use native threading instead."},{"line_number":127,"context_line":"    glance.async_.set_threadpool_model(\u0027native\u0027)"},{"line_number":128,"context_line":"    if uwsgi:"},{"line_number":129,"context_line":"        uwsgi.atexit \u003d drain_workers"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    # NOTE(danms): Change the default threadpool size since we"},{"line_number":132,"context_line":"    # are dealing with native threads and not greenthreads."}],"source_content_type":"text/x-python","patch_set":9,"id":"d34b733c_df0eceb6","line":129,"in_reply_to":"86fd13de_c119e48f","updated":"2022-07-12 06:40:01.000000000","message":"Done","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4b49db24d72656000a79992851498b0b97207aeb","unresolved":true,"context_lines":[{"line_number":126,"context_line":"    # use native threading instead."},{"line_number":127,"context_line":"    glance.async_.set_threadpool_model(\u0027native\u0027)"},{"line_number":128,"context_line":"    if uwsgi:"},{"line_number":129,"context_line":"        uwsgi.atexit \u003d drain_workers"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    # NOTE(danms): Change the default threadpool size since we"},{"line_number":132,"context_line":"    # are dealing with native threads and not greenthreads."}],"source_content_type":"text/x-python","patch_set":9,"id":"39b8d60f_b4761b77","line":129,"in_reply_to":"ec7e3cb0_f540e926","updated":"2022-07-06 06:02:00.000000000","message":"can I simply add \u0027atexit.register(drain_threadpools)\u0027 in else part here, adding config option for this doesn\u0027t sound good way of doing it to me.","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"84e3ed853750c92e4e573fd6fc227af2ca7b9659","unresolved":true,"context_lines":[{"line_number":41,"context_line":"except ImportError:"},{"line_number":42,"context_line":"    LOG.debug(\u0027Detected not running under uwsgi\u0027)"},{"line_number":43,"context_line":"    uwsgi \u003d None"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"CONFIG_FILES \u003d [\u0027glance-api-paste.ini\u0027,"},{"line_number":46,"context_line":"                \u0027glance-image-import.conf\u0027,"},{"line_number":47,"context_line":"                \u0027glance-api.conf\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"15fbfa71_2868b932","line":44,"updated":"2022-07-19 14:23:14.000000000","message":"Does this really work? Can\u0027t we have a configuration that does not use uswgi, but with uwsgi available on the machine, for instance?","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4b4657bc01d57b07f74e3099dcc3c5e6e07f4066","unresolved":true,"context_lines":[{"line_number":41,"context_line":"except ImportError:"},{"line_number":42,"context_line":"    LOG.debug(\u0027Detected not running under uwsgi\u0027)"},{"line_number":43,"context_line":"    uwsgi \u003d None"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"CONFIG_FILES \u003d [\u0027glance-api-paste.ini\u0027,"},{"line_number":46,"context_line":"                \u0027glance-image-import.conf\u0027,"},{"line_number":47,"context_line":"                \u0027glance-api.conf\u0027]"}],"source_content_type":"text/x-python","patch_set":13,"id":"0158e197_a5e0e1c0","line":44,"in_reply_to":"15fbfa71_2868b932","updated":"2022-07-19 14:32:42.000000000","message":"This is a special import that only exists when you\u0027re loaded by uwsgi\u0027s integrated python interpreter. It\u0027s not actually on the machine as a python module.\n\n dan@guaranine:~$ dpkg -L uwsgi-plugin-python3 | grep lib\n /usr/lib\n /usr/lib/uwsgi\n /usr/lib/uwsgi/plugins\n /usr/lib/uwsgi/plugins/python38_plugin.so\n dan@guaranine:~$ python3\n Python 3.8.10 (default, Mar 15 2022, 12:22:08)\n [GCC 9.4.0] on linux\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n \u003e\u003e\u003e import uwsgi\n Traceback (most recent call last):\n   File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n ModuleNotFoundError: No module named \u0027uwsgi\u0027\n \u003e\u003e\u003e","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"}],"glance/tests/functional/v2/test_cache_api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1a452e37a1b2d83618fb15dd09df65a5be4e196a","unresolved":true,"context_lines":[{"line_number":237,"context_line":"        self.cache_image()"},{"line_number":238,"context_line":"        output \u003d self.list_cache()"},{"line_number":239,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":240,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test_cache_image_queue_delete(self):"},{"line_number":243,"context_line":"        # This test verifies that if image is queued for caching"}],"source_content_type":"text/x-python","patch_set":3,"id":"27cf023a_e71f01ca","line":240,"updated":"2022-06-13 14:14:07.000000000","message":"Might be good to leave this case in. Even though it\u0027s not something we can really verify, if there was some failure related to caching an already-cached image, this might poke it.","commit_id":"7e43a706b27df6ebf9c55b1cbd05176b4e53508c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        self.cache_image()"},{"line_number":238,"context_line":"        output \u003d self.list_cache()"},{"line_number":239,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":240,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test_cache_image_queue_delete(self):"},{"line_number":243,"context_line":"        # This test verifies that if image is queued for caching"}],"source_content_type":"text/x-python","patch_set":3,"id":"0c19fc52_fce1edc7","line":240,"in_reply_to":"27cf023a_e71f01ca","updated":"2022-06-15 08:24:50.000000000","message":"Ack","commit_id":"7e43a706b27df6ebf9c55b1cbd05176b4e53508c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1a452e37a1b2d83618fb15dd09df65a5be4e196a","unresolved":true,"context_lines":[{"line_number":110,"context_line":"        while time.time() \u003c\u003d done_time:"},{"line_number":111,"context_line":"            output \u003d self.list_cache()[\u0027cached_images\u0027]"},{"line_number":112,"context_line":"            if output and image_id in output[0][\u0027image_id\u0027]:"},{"line_number":113,"context_line":"                return"},{"line_number":114,"context_line":"            time.sleep(delay_sec)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        msg \u003d \"Image {0} failed to cached within {1} sec\""}],"source_content_type":"text/x-python","patch_set":5,"id":"8e5ca70d_fac764bc","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":22},"updated":"2022-06-13 14:14:07.000000000","message":"Maybe make this:\n\n return output\n\nso we can use it below instead of re-querying it?","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        while time.time() \u003c\u003d done_time:"},{"line_number":111,"context_line":"            output \u003d self.list_cache()[\u0027cached_images\u0027]"},{"line_number":112,"context_line":"            if output and image_id in output[0][\u0027image_id\u0027]:"},{"line_number":113,"context_line":"                return"},{"line_number":114,"context_line":"            time.sleep(delay_sec)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        msg \u003d \"Image {0} failed to cached within {1} sec\""}],"source_content_type":"text/x-python","patch_set":5,"id":"21f1ea3f_1fb90cae","line":113,"range":{"start_line":113,"start_character":16,"end_line":113,"end_character":22},"in_reply_to":"8e5ca70d_fac764bc","updated":"2022-06-15 08:24:50.000000000","message":"this will only return \u0027cached_images\u0027 and not \u0027queued_images\u0027","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1a452e37a1b2d83618fb15dd09df65a5be4e196a","unresolved":true,"context_lines":[{"line_number":151,"context_line":"        # Delete public image from cache"},{"line_number":152,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":153,"context_line":"        # Now verify that we have 2 cached images"},{"line_number":154,"context_line":"        output \u003d self.list_cache()"},{"line_number":155,"context_line":"        self.assertEqual(2, len(output[\u0027cached_images\u0027]))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Verify clearing cache fails with 400 if invalid header is passed"}],"source_content_type":"text/x-python","patch_set":5,"id":"5c8a4998_fc95e81c","line":154,"updated":"2022-06-13 14:14:07.000000000","message":"We should wait_for_caching() here right? Otherwise we could race for caching to complete and this test becomes flaky.","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        # Delete public image from cache"},{"line_number":152,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":153,"context_line":"        # Now verify that we have 2 cached images"},{"line_number":154,"context_line":"        output \u003d self.list_cache()"},{"line_number":155,"context_line":"        self.assertEqual(2, len(output[\u0027cached_images\u0027]))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Verify clearing cache fails with 400 if invalid header is passed"}],"source_content_type":"text/x-python","patch_set":5,"id":"348ea2c3_d6ab8638","line":154,"in_reply_to":"5c8a4998_fc95e81c","updated":"2022-06-15 08:24:50.000000000","message":"here we are not adding any new image for caching, but we can certainly add wait statement after line 146","commit_id":"09f421ec74fdafba9394c39458ed097d7c9fb26d"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3b761874ec3ad2384d6bd21ac7264e5935183e57","unresolved":true,"context_lines":[{"line_number":152,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":153,"context_line":"        # Now verify that we have 2 cached images"},{"line_number":154,"context_line":"        output \u003d self.list_cache()"},{"line_number":155,"context_line":"        self.assertEqual(2, len(output[\u0027cached_images\u0027]))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Verify clearing cache fails with 400 if invalid header is passed"},{"line_number":158,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027, expected_code\u003d400)"}],"source_content_type":"text/x-python","patch_set":6,"id":"126cb6f7_5852ce56","line":155,"updated":"2022-06-15 08:24:50.000000000","message":"Indeed, this test is flaky even after adding wait_for_caching at all required places.","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"686542b2060ed1af67dd38d8d0cd78385010aa04","unresolved":true,"context_lines":[{"line_number":152,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":153,"context_line":"        # Now verify that we have 2 cached images"},{"line_number":154,"context_line":"        output \u003d self.list_cache()"},{"line_number":155,"context_line":"        self.assertEqual(2, len(output[\u0027cached_images\u0027]))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Verify clearing cache fails with 400 if invalid header is passed"},{"line_number":158,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027, expected_code\u003d400)"}],"source_content_type":"text/x-python","patch_set":6,"id":"faefe0b1_000e2d88","line":155,"in_reply_to":"126cb6f7_5852ce56","updated":"2022-06-16 05:19:40.000000000","message":"I think better to break down this test in multiple tests to avoid race and unwanted failure.","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"858762174a3c45dca8d0646b74ef783885fb9793","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        self.cache_delete(images[\u0027public\u0027])"},{"line_number":153,"context_line":"        # Now verify that we have 2 cached images"},{"line_number":154,"context_line":"        output \u003d self.list_cache()"},{"line_number":155,"context_line":"        self.assertEqual(2, len(output[\u0027cached_images\u0027]))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        # Verify clearing cache fails with 400 if invalid header is passed"},{"line_number":158,"context_line":"        self.cache_clear(target\u003d\u0027both\u0027, expected_code\u003d400)"}],"source_content_type":"text/x-python","patch_set":6,"id":"cdce5a03_710d3076","line":155,"in_reply_to":"faefe0b1_000e2d88","updated":"2022-06-20 14:43:40.000000000","message":"Done","commit_id":"7b457f245b3c57977915c764dffc3a224da1fd7e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"10ebdc402756edf64d955c91556e82c955517737","unresolved":true,"context_lines":[{"line_number":143,"context_line":"        # Queue 1 image for caching"},{"line_number":144,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":145,"context_line":"        output \u003d self.list_cache()"},{"line_number":146,"context_line":"        self.assertEqual(1, len(output[\u0027queued_images\u0027]))"},{"line_number":147,"context_line":"        self.wait_for_caching(images[\u0027public\u0027])"},{"line_number":148,"context_line":"        # Now verify that we have 1 cached image"},{"line_number":149,"context_line":"        output \u003d self.list_cache()"}],"source_content_type":"text/x-python","patch_set":9,"id":"30c145ed_97199b3f","line":146,"updated":"2022-07-05 14:14:17.000000000","message":"This is a race, which we could lose if the remote side caches the image too quickly. Perhaps we could check output[\u0027cached_images\u0027] and not freak out if it doesn\u0027t show up in queued...\n\nI would at least put a #NOTE here about it being a race so that if/when we start having failures we can come address it.","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4b49db24d72656000a79992851498b0b97207aeb","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        # Queue 1 image for caching"},{"line_number":144,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":145,"context_line":"        output \u003d self.list_cache()"},{"line_number":146,"context_line":"        self.assertEqual(1, len(output[\u0027queued_images\u0027]))"},{"line_number":147,"context_line":"        self.wait_for_caching(images[\u0027public\u0027])"},{"line_number":148,"context_line":"        # Now verify that we have 1 cached image"},{"line_number":149,"context_line":"        output \u003d self.list_cache()"}],"source_content_type":"text/x-python","patch_set":9,"id":"0c686bf2_8fffd462","line":146,"in_reply_to":"30c145ed_97199b3f","updated":"2022-07-06 06:02:00.000000000","message":"Ack","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"91393c4742248969e485e1c758040362d4caddf3","unresolved":true,"context_lines":[{"line_number":178,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":179,"context_line":"        self.cache_queue(images[\u0027private\u0027])"},{"line_number":180,"context_line":"        # Now verify that we have 2 queued images"},{"line_number":181,"context_line":"        # NOTE(abhishekk): We might fail with race here as queue call"},{"line_number":182,"context_line":"        # will immediately start caching of an image, so we may not find"},{"line_number":183,"context_line":"        # all images in queued state."},{"line_number":184,"context_line":"        output \u003d self.list_cache()"},{"line_number":185,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"},{"line_number":186,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"877db534_c8653c3d","line":183,"range":{"start_line":181,"start_character":0,"end_line":183,"end_character":37},"updated":"2022-07-18 16:27:41.000000000","message":"This is a good point, we\u0027ll have to look out for it.","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11adeaf1c8e7f7b69acfa5535c16cd4ddbcf50e4","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        self.cache_queue(images[\u0027public\u0027])"},{"line_number":179,"context_line":"        self.cache_queue(images[\u0027private\u0027])"},{"line_number":180,"context_line":"        # Now verify that we have 2 queued images"},{"line_number":181,"context_line":"        # NOTE(abhishekk): We might fail with race here as queue call"},{"line_number":182,"context_line":"        # will immediately start caching of an image, so we may not find"},{"line_number":183,"context_line":"        # all images in queued state."},{"line_number":184,"context_line":"        output \u003d self.list_cache()"},{"line_number":185,"context_line":"        self.assertEqual(2, len(output[\u0027queued_images\u0027]))"},{"line_number":186,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"1c5a2419_30f6782e","line":183,"range":{"start_line":181,"start_character":0,"end_line":183,"end_character":37},"in_reply_to":"877db534_c8653c3d","updated":"2022-07-18 16:39:41.000000000","message":"Ack","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"91393c4742248969e485e1c758040362d4caddf3","unresolved":true,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # Clear all images from cache"},{"line_number":210,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":211,"context_line":"        # Now verify that we have 0 queued images"},{"line_number":212,"context_line":"        output \u003d self.list_cache()"},{"line_number":213,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":214,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"4695a376_048c9027","line":211,"range":{"start_line":211,"start_character":36,"end_line":211,"end_character":42},"updated":"2022-07-18 16:27:41.000000000","message":"I think you mean \u0027cached\u0027 here.","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"11adeaf1c8e7f7b69acfa5535c16cd4ddbcf50e4","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        # Clear all images from cache"},{"line_number":210,"context_line":"        self.cache_clear(target\u003d\u0027cache\u0027)"},{"line_number":211,"context_line":"        # Now verify that we have 0 queued images"},{"line_number":212,"context_line":"        output \u003d self.list_cache()"},{"line_number":213,"context_line":"        self.assertEqual(0, len(output[\u0027queued_images\u0027]))"},{"line_number":214,"context_line":"        self.assertEqual(0, len(output[\u0027cached_images\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"bb6e472d_3e7857de","line":211,"range":{"start_line":211,"start_character":36,"end_line":211,"end_character":42},"in_reply_to":"4695a376_048c9027","updated":"2022-07-18 16:39:41.000000000","message":"Done","commit_id":"1dbd0193601c773adbc4b3806aa4c002e698deea"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"84e3ed853750c92e4e573fd6fc227af2ca7b9659","unresolved":true,"context_lines":[{"line_number":52,"context_line":"        image_id \u003d response.json[\u0027id\u0027]"},{"line_number":53,"context_line":"        output[\u0027queued\u0027] \u003d image_id"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        for visibility in [\u0027public\u0027, \u0027private\u0027]:"},{"line_number":56,"context_line":"            data \u003d {"},{"line_number":57,"context_line":"                \u0027name\u0027: \u0027%s-image\u0027 % visibility,"},{"line_number":58,"context_line":"                \u0027visibility\u0027: visibility,"}],"source_content_type":"text/x-python","patch_set":13,"id":"65696cbf_c31faa69","line":55,"updated":"2022-07-19 14:23:14.000000000","message":"Why do we switch to using only 2 images instead of 4 in our tests?","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"de55fafa7138a4d9ea8ebf194667f023ad90ff28","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        image_id \u003d response.json[\u0027id\u0027]"},{"line_number":53,"context_line":"        output[\u0027queued\u0027] \u003d image_id"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        for visibility in [\u0027public\u0027, \u0027private\u0027]:"},{"line_number":56,"context_line":"            data \u003d {"},{"line_number":57,"context_line":"                \u0027name\u0027: \u0027%s-image\u0027 % visibility,"},{"line_number":58,"context_line":"                \u0027visibility\u0027: visibility,"}],"source_content_type":"text/x-python","patch_set":13,"id":"794be639_e13ff751","line":55,"in_reply_to":"65696cbf_c31faa69","updated":"2022-07-19 14:57:52.000000000","message":"only reason is there is no point of running same set of test on different types of image again and again. Image type does not have any impact on caching.","commit_id":"c1a2b9e2217498d86948a9be1b141483e5185453"}],"glance/tests/unit/common/test_wsgi_app.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"10ebdc402756edf64d955c91556e82c955517737","unresolved":true,"context_lines":[{"line_number":51,"context_line":"        try:"},{"line_number":52,"context_line":"            import uwsgi"},{"line_number":53,"context_line":"        except ImportError:"},{"line_number":54,"context_line":"            self.skipTest(\"Skipping test as not running under uwsgi!\")"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        mock_config_files.return_value \u003d []"},{"line_number":57,"context_line":"        with mock.patch.object(uwsgi, \u0027atexit\u0027) as mock_exit:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7cb5706b_b5c59a8d","line":54,"updated":"2022-07-05 14:14:17.000000000","message":"When (and how) would we ever run tests under uwsgi? Since it happens at import time, we can just set the flag to False in BaseTest and then set it to True here before we check for the uwsgi-specific parts. There\u0027s no real easy way to get the \"if importerror\" logic that I know of, but that should be covered by the integration tests anyway.","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4b49db24d72656000a79992851498b0b97207aeb","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        try:"},{"line_number":52,"context_line":"            import uwsgi"},{"line_number":53,"context_line":"        except ImportError:"},{"line_number":54,"context_line":"            self.skipTest(\"Skipping test as not running under uwsgi!\")"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        mock_config_files.return_value \u003d []"},{"line_number":57,"context_line":"        with mock.patch.object(uwsgi, \u0027atexit\u0027) as mock_exit:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5197d614_b3eb02be","line":54,"in_reply_to":"7cb5706b_b5c59a8d","updated":"2022-07-06 06:02:00.000000000","message":"Ack","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5a23cf043c71c051b043aa786c81ec9f793910ec","unresolved":true,"context_lines":[{"line_number":49,"context_line":"                                              mock_set_model,"},{"line_number":50,"context_line":"                                              mock_load, mock_exit):"},{"line_number":51,"context_line":"        mock_config_files.return_value \u003d []"},{"line_number":52,"context_line":"        wsgi_app.init_app()"},{"line_number":53,"context_line":"        mock_exit.assert_called_once_with(wsgi_app.drain_workers)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @mock.patch(\u0027glance.api.v2.cached_images.WORKER\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"4d4ac9b3_60a44e0a","line":52,"updated":"2022-07-15 15:27:16.000000000","message":"This is cool for the non-uwsgi fallback case, but we still need to test the uwsgi case right?\n\nYou should be able to patch.object(wsgi_app, \u0027uwsgi\u0027), which will make that non-none and thus do the register with the uwsgi-specific one.","commit_id":"76570684caf6083e517f88c20d6485b3fac284bd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"21272bfd2651b0ca6f2118f009e5f6eb5aa595ff","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                              mock_set_model,"},{"line_number":50,"context_line":"                                              mock_load, mock_exit):"},{"line_number":51,"context_line":"        mock_config_files.return_value \u003d []"},{"line_number":52,"context_line":"        wsgi_app.init_app()"},{"line_number":53,"context_line":"        mock_exit.assert_called_once_with(wsgi_app.drain_workers)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @mock.patch(\u0027glance.api.v2.cached_images.WORKER\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"129add85_b76b05e3","line":52,"in_reply_to":"4d4ac9b3_60a44e0a","updated":"2022-07-15 16:10:48.000000000","message":"Done","commit_id":"76570684caf6083e517f88c20d6485b3fac284bd"}],"releasenotes/notes/immediate-caching-image-e38055575c361d32.yaml":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"10ebdc402756edf64d955c91556e82c955517737","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added support to calculate virtual size of image based on disk format"},{"line_number":5,"context_line":"upgrade:"},{"line_number":6,"context_line":"  - |"},{"line_number":7,"context_line":"    Periodic job to prefetch image(s) into cache has been removed from the"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"f2ae0b96_576c00fd","line":4,"updated":"2022-07-05 14:14:17.000000000","message":"...was this intentional?","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4b49db24d72656000a79992851498b0b97207aeb","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added support to calculate virtual size of image based on disk format"},{"line_number":5,"context_line":"upgrade:"},{"line_number":6,"context_line":"  - |"},{"line_number":7,"context_line":"    Periodic job to prefetch image(s) into cache has been removed from the"}],"source_content_type":"text/x-yaml","patch_set":9,"id":"4bf4272f_51606ba3","line":4,"in_reply_to":"f2ae0b96_576c00fd","updated":"2022-07-06 06:02:00.000000000","message":"By mistake.","commit_id":"bf226965af00bb989aec55ae72ef210c5b153cde"}]}
