)]}'
{"nova/virt/libvirt/imagebackend.py":[{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b664ce0f12ad36e463fb27c1feab14dc0595e631","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        if not os.path.exists(base_dir):"},{"line_number":183,"context_line":"            fileutils.ensure_tree(base_dir)"},{"line_number":184,"context_line":"        base \u003d os.path.join(base_dir, filename)"},{"line_number":185,"context_line":"        imagecache.refresh_timestamp(base)"},{"line_number":186,"context_line":"        if not self.check_image_exists() or not os.path.exists(base):"},{"line_number":187,"context_line":"            self.create_image(fetch_func_sync, base, size,"},{"line_number":188,"context_line":"                              *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2BqI%3D","line":185,"updated":"2014-01-20 06:44:08.000000000","message":"maybe a os.path.exist(base) check to avoid additional lock is better","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"}],"nova/virt/libvirt/imagecache.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6548bbf5148137fcee2afb07250e9c3b30a5c142","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    \"\"\"Update age of a file not to removed from the cache.\"\"\""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":265,"context_line":"    def inner_refresh_timestamp():"},{"line_number":266,"context_line":"        if os.path.exists(base_file):"},{"line_number":267,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":268,"context_line":"            os.utime(base_file, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FlSA%3D","line":265,"updated":"2014-01-10 19:41:27.000000000","message":"Why decorate an inner function, instead of decorating the refresh_timestamp() function itself?","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ffae9e72c78e2acc34bb8cf26590bc3b542d3aaf","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    \"\"\"Update age of a file not to removed from the cache.\"\"\""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":265,"context_line":"    def inner_refresh_timestamp():"},{"line_number":266,"context_line":"        if os.path.exists(base_file):"},{"line_number":267,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":268,"context_line":"            os.utime(base_file, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FkiM%3D","line":265,"in_reply_to":"AAAAUH%2F%2FkxE%3D","updated":"2014-01-10 22:19:53.000000000","message":"OK, I see it now…","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"091f2b155ced13c969b3361318ce506a5ffbfe6a","unresolved":false,"context_lines":[{"line_number":262,"context_line":"    \"\"\"Update age of a file not to removed from the cache.\"\"\""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":265,"context_line":"    def inner_refresh_timestamp():"},{"line_number":266,"context_line":"        if os.path.exists(base_file):"},{"line_number":267,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":268,"context_line":"            os.utime(base_file, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FkxE%3D","line":265,"in_reply_to":"AAAAUH%2F%2FlSA%3D","updated":"2014-01-10 21:34:38.000000000","message":"It is because base_file is not defined outside of the outer function.\n\nIf the arg for _lock_for_refresh() were a constant, the outer function cloud be decorated directly. But actually we have to use different lock files according to the value of base_file.","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"219717f7b5b5bfae0d93aa3e1e6e7d04a8477c1b","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":265,"context_line":"    def inner_refresh_timestamp():"},{"line_number":266,"context_line":"        if os.path.exists(base_file):"},{"line_number":267,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":268,"context_line":"            os.utime(base_file, None)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    inner_refresh_timestamp()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FHMI%3D","line":267,"updated":"2014-01-17 10:29:58.000000000","message":"Why a chown? The base file should already be owned by the libvirt user, right?","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"169655484eb91e344e7b4517abd18a6589e4ad63","unresolved":false,"context_lines":[{"line_number":264,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":265,"context_line":"    def inner_refresh_timestamp():"},{"line_number":266,"context_line":"        if os.path.exists(base_file):"},{"line_number":267,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":268,"context_line":"            os.utime(base_file, None)"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    inner_refresh_timestamp()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FHFo%3D","line":267,"in_reply_to":"AAAAUH%2F%2FHMI%3D","updated":"2014-01-17 10:46:06.000000000","message":"commit log says chown is needed to fix this bug:\n\nhttps://bugs.launchpad.net/ubuntu/+source/nova/+bug/973377\nhttps://review.openstack.org/#/c/6231/","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"6548bbf5148137fcee2afb07250e9c3b30a5c142","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        # should return immediately instead of blocking meaninglessly."},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        @_lock_for_refresh(base_file)"},{"line_number":499,"context_line":"        def inner_remove_base_file():"},{"line_number":500,"context_line":"            if not os.path.exists(base_file):"},{"line_number":501,"context_line":"                LOG.debug(_(\u0027Cannot remove %(base_file)s, it does not exist\u0027),"},{"line_number":502,"context_line":"                          base_file)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FlR4%3D","line":499,"updated":"2014-01-10 19:41:27.000000000","message":"Same question here…","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"091f2b155ced13c969b3361318ce506a5ffbfe6a","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        # should return immediately instead of blocking meaninglessly."},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        @_lock_for_refresh(base_file)"},{"line_number":499,"context_line":"        def inner_remove_base_file():"},{"line_number":500,"context_line":"            if not os.path.exists(base_file):"},{"line_number":501,"context_line":"                LOG.debug(_(\u0027Cannot remove %(base_file)s, it does not exist\u0027),"},{"line_number":502,"context_line":"                          base_file)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FkxA%3D","line":499,"in_reply_to":"AAAAUH%2F%2FlR4%3D","updated":"2014-01-10 21:34:38.000000000","message":"The same reason above.","commit_id":"84c11c7f4f4f1aa5a283ab4fd0e0faba3cc4279b"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"57593448d15301cb6383c1b38f748fa7bc2095f0","unresolved":false,"context_lines":[{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":255,"context_line":"    def inner_refresh_timestamp():"},{"line_number":256,"context_line":"        if os.path.exists(base_file):"},{"line_number":257,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":258,"context_line":"            os.utime(base_file, None)"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B97I%3D","line":256,"updated":"2014-01-20 09:48:31.000000000","message":"I feel like this check could occur outside the lock.","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"d031f31c2b266894b630526791f71604e4c00302","unresolved":false,"context_lines":[{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    @_lock_for_refresh(base_file)"},{"line_number":255,"context_line":"    def inner_refresh_timestamp():"},{"line_number":256,"context_line":"        if os.path.exists(base_file):"},{"line_number":257,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":258,"context_line":"            os.utime(base_file, None)"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B344%3D","line":256,"in_reply_to":"AAAAUH%2F%2B97I%3D","updated":"2014-01-21 08:32:32.000000000","message":"_remove_base_file() may delete the base_file. So we have to check the base_file after acquire the lock.","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"d031f31c2b266894b630526791f71604e4c00302","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        if os.path.exists(base_file):"},{"line_number":257,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":258,"context_line":"            os.utime(base_file, None)"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    inner_refresh_timestamp()"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B348%3D","line":259,"updated":"2014-01-21 08:32:32.000000000","message":"Checking twice (before and after lock) will eliminate the lock when the base_file does not exist.","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"b664ce0f12ad36e463fb27c1feab14dc0595e631","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                          {\u0027id\u0027: img_id,"},{"line_number":556,"context_line":"                           \u0027base_file\u0027: base_file})"},{"line_number":557,"context_line":"                # TODO(arata): Should not block to acquire the lock here"},{"line_number":558,"context_line":"                # as well in _remove_base_file()"},{"line_number":559,"context_line":"                refresh_timestamp(base_file)"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def _age_and_verify_cached_images(self, context, all_instances, base_dir):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2BqU%3D","line":558,"updated":"2014-01-20 06:44:08.000000000","message":"I know this is original code ,but looks to me it\u0027s in periodic task \nwhy we need to update image modification time in this ? \nmy assumption is we need to update image modification time every time it\u0027s  used not accessed","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"d031f31c2b266894b630526791f71604e4c00302","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                          {\u0027id\u0027: img_id,"},{"line_number":556,"context_line":"                           \u0027base_file\u0027: base_file})"},{"line_number":557,"context_line":"                # TODO(arata): Should not block to acquire the lock here"},{"line_number":558,"context_line":"                # as well in _remove_base_file()"},{"line_number":559,"context_line":"                refresh_timestamp(base_file)"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def _age_and_verify_cached_images(self, context, all_instances, base_dir):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B35U%3D","line":558,"in_reply_to":"AAAAUH%2F%2B%2BqU%3D","updated":"2014-01-21 08:32:32.000000000","message":"This is my understanding:\n\nImagecache wants to know how long the base_file has not been used. However base_file is never updated once it is created and its modification time is not changed, in nature. So imagecache has to do it by itself; periodically checks instances and updates modification time to store the last time that the base_file has an instance.","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"d4a3fe93077a5b5cb71aa39d396832a12a193d2c","unresolved":false,"context_lines":[{"line_number":555,"context_line":"                          {\u0027id\u0027: img_id,"},{"line_number":556,"context_line":"                           \u0027base_file\u0027: base_file})"},{"line_number":557,"context_line":"                # TODO(arata): Should not block to acquire the lock here"},{"line_number":558,"context_line":"                # as well in _remove_base_file()"},{"line_number":559,"context_line":"                refresh_timestamp(base_file)"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def _age_and_verify_cached_images(self, context, all_instances, base_dir):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B2Ac%3D","line":558,"in_reply_to":"AAAAUH%2F%2B35U%3D","updated":"2014-01-21 14:30:17.000000000","message":"that make sense, I agree with your comments\nlooks to me your patch will make the calculation more accurate... thanks for your time","commit_id":"13de1f5acadfcd44cf69e1f140f1e782b5f85d0c"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"ab0e9bb66e7e51a94bbc343e2d367fa76431bb2f","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        if os.path.exists(base_file):"},{"line_number":257,"context_line":"            virtutils.chown(base_file, os.getuid())"},{"line_number":258,"context_line":"            os.utime(base_file, None)"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    if os.path.exists(base_file):"},{"line_number":261,"context_line":"        inner_refresh_timestamp()"},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2B3zA%3D","line":259,"updated":"2014-01-21 08:38:41.000000000","message":"here","commit_id":"2593469103aa7d9d2bcb759b78d5f8637911a1e0"},{"author":{"_account_id":3068,"name":"Arata Notsu","email":"notsu@virtualtech.jp","username":"arata776"},"change_message_id":"ab0e9bb66e7e51a94bbc343e2d367fa76431bb2f","unresolved":false,"context_lines":[{"line_number":487,"context_line":"                                \u0027error was %(error)s\u0027),"},{"line_number":488,"context_line":"                              {\u0027base_file\u0027: base_file,"},{"line_number":489,"context_line":"                               \u0027error\u0027: e})"},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"        if not os.path.exists(base_file):"},{"line_number":492,"context_line":"            LOG.debug(_(\u0027Cannot remove %(base_file)s, it does not exist\u0027),"},{"line_number":493,"context_line":"                      base_file)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2B3y0%3D","line":490,"updated":"2014-01-21 08:38:41.000000000","message":"here","commit_id":"2593469103aa7d9d2bcb759b78d5f8637911a1e0"}]}
