)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"080d92d80ddb5dd45a256d80223e2dfdc10d3612","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"302b4e92_24a54116","updated":"2022-06-28 08:04:24.000000000","message":"recheck","commit_id":"1bd6a1e92fb6f8f251854a230eed37af5afe72bf"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"1ec5854b227ea7e7a23f33a6251fdde389088c54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"8516bba1_f467d84e","updated":"2022-05-14 13:58:12.000000000","message":"recheck","commit_id":"1bd6a1e92fb6f8f251854a230eed37af5afe72bf"}],"zuul/web/__init__.py":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"9b3b729f3f23d08f5767b29ec0ce031d3ec34e38","unresolved":true,"context_lines":[{"line_number":372,"context_line":"        }"},{"line_number":373,"context_line":"        self.cache_expiry \u003d 1"},{"line_number":374,"context_line":"        self.static_cache_expiry \u003d zuulweb.static_cache_expiry"},{"line_number":375,"context_line":"        self.cache_lock \u003d threading.Lock()"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"    @property"},{"line_number":378,"context_line":"    def log(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5ea72be5_23e5ed8a","line":375,"updated":"2022-03-08 18:11:53.000000000","message":"-1: I think we should have a separate lock for the tenant list since it\u0027s different caches.\n\nsuggestion: There is already a change that optimizes the locking for the status endpoint by tenant [1] which will conflict with this. It might make sense to rebase this change on top of it.\n\n[1] https://review.opendev.org/c/zuul/zuul/+/772695","commit_id":"941b5ef2ab3371b3f5ffbb5294e6a644faaee5ea"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"77486175e128033a8f327094b9cb40321f4cfa9a","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        }"},{"line_number":373,"context_line":"        self.cache_expiry \u003d 1"},{"line_number":374,"context_line":"        self.static_cache_expiry \u003d zuulweb.static_cache_expiry"},{"line_number":375,"context_line":"        self.cache_lock \u003d threading.Lock()"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"    @property"},{"line_number":378,"context_line":"    def log(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"f59f6522_5bc6fc86","line":375,"in_reply_to":"5ea72be5_23e5ed8a","updated":"2022-03-09 13:55:05.000000000","message":"Done","commit_id":"941b5ef2ab3371b3f5ffbb5294e6a644faaee5ea"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"14b6f4e6e5e2dbf531d30716228a7c6e88016c60","unresolved":true,"context_lines":[{"line_number":971,"context_line":"    @cherrypy.expose"},{"line_number":972,"context_line":"    @cherrypy.tools.json_out(content_type\u003d\u0027application/json; charset\u003dutf-8\u0027)"},{"line_number":973,"context_line":"    def tenants(self):"},{"line_number":974,"context_line":"        with self.caches[\u0027tenants\u0027][\u0027lock\u0027]:"},{"line_number":975,"context_line":"            cache_time \u003d self.caches[\u0027tenants\u0027][\u0027cache_time\u0027]"},{"line_number":976,"context_line":"            if time.time() - cache_time \u003e self.cache_expiry:"},{"line_number":977,"context_line":"                self.caches[\u0027tenants\u0027][\u0027cache\u0027] \u003d self._tenants()"}],"source_content_type":"text/x-python","patch_set":4,"id":"7c6f71f9_75fce270","line":974,"updated":"2022-03-22 22:36:24.000000000","message":"-1: We only need to protect updating the cache with a lock. Reading from the cache shouldn\u0027t require a lock.\n\n0: We could even go the non-blocking lock way we do like in getStatus to not block requests while the tenant list is updated.","commit_id":"dcf60a706bbe0badf5020b30dd794ff41b397277"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"14b6f4e6e5e2dbf531d30716228a7c6e88016c60","unresolved":true,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"    def _getStatus(self, tenant_name):"},{"line_number":1016,"context_line":"        tenant \u003d self._getTenantOrRaise(tenant_name)"},{"line_number":1017,"context_line":"        cache_time \u003d self.caches[\u0027status\u0027][\u0027cache_time\u0027].get("},{"line_number":1018,"context_line":"            tenant_name,"},{"line_number":1019,"context_line":"            0)"},{"line_number":1020,"context_line":"        if tenant_name not in self.caches[\u0027status\u0027][\u0027lock\u0027] or \\"}],"source_content_type":"text/x-python","patch_set":4,"id":"8fde9b5c_e34ab2ef","line":1017,"updated":"2022-03-22 22:36:24.000000000","message":"nit: I think this method would be easier to read if we put \"self.caches[\u0027status\u0027]\" into a local variable.","commit_id":"dcf60a706bbe0badf5020b30dd794ff41b397277"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"fc20c5d4fc461525b59f19b3bf29063768b54363","unresolved":false,"context_lines":[{"line_number":371,"context_line":"                \u0027cache_time\u0027: 0,"},{"line_number":372,"context_line":"                \u0027lock\u0027: threading.Lock()"},{"line_number":373,"context_line":"            },"},{"line_number":374,"context_line":"        }"},{"line_number":375,"context_line":"        self.cache_expiry \u003d 1"},{"line_number":376,"context_line":"        self.static_cache_expiry \u003d zuulweb.static_cache_expiry"},{"line_number":377,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"260720b8_b8541cd6","line":374,"updated":"2022-06-27 21:09:02.000000000","message":"Nit: These don\u0027t actually behave the same way, so it feels a little misleading to have them share the same data structure.  I don\u0027t think there\u0027s an advantage over just doing:\n\nself.status_cache \u003d {}\nself.status_cache_time \u003d {}\nself.status_cache_lock \u003d defaultdict(threading.Lock)\n...\n\nUses fewer lines, less subject to typos, and static analysis (ie, pyflakes) can run on it.","commit_id":"1bd6a1e92fb6f8f251854a230eed37af5afe72bf"}]}
